how to use who to get a list of variable in the workspace and then use them as variables in a function?

3 次查看(过去 30 天)
>> who
Your variables are:
Angle2G_1_phi90 Angle5G_3_tot_th90 Power2G_5_th90 Angle2G_1_th90 Angle5G_4_phi90 Power2G_5_tot_th90 Angle2G_1_tot_th90 Angle5G_4_th90 Power2G_6_phi90 Angle2G_2_phi90 Angle5G_4_tot_th90 Power2G_6_th90 Angle2G_2_th90 Angle5G_5_phi90 Power2G_6_tot_th90 Angle2G_2_tot_th90 Angle5G_5_th90 Power5G_2_phi90 Angle2G_3_phi90 Angle5G_5_tot_th90 Power5G_2_th90 Angle2G_3_th90 Angle5G_6_phi90 Power5G_2_tot_th90 Angle2G_3_tot_th90 Angle5G_6_th90 Power5G_3_phi90 Angle2G_4_phi90 Angle5G_6_tot_th90 Power5G_3_th90 Angle2G_4_th90 Power2G_1_phi90 Power5G_3_tot_th90 Angle2G_4_tot_th90 Power2G_1_th90 Power5G_4_phi90 Angle2G_5_phi90 Power2G_1_tot_th90 Power5G_4_th90 Angle2G_5_th90 Power2G_2_phi90 Power5G_4_tot_th90 Angle2G_5_tot_th90 Power2G_2_th90 Power5G_5_phi90 Angle2G_6_phi90 Power2G_2_tot_th90 Power5G_5_th90 Angle2G_6_th90 Power2G_3_phi90 Power5G_5_tot_th90 Angle2G_6_tot_th90 Power2G_3_th90 Power5G_6_phi90 Angle5G_2_phi90 Power2G_3_tot_th90 Power5G_6_th90 Angle5G_2_th90 Power2G_4_phi90 Power5G_6_tot_th90 Angle5G_2_tot_th90 Power2G_4_th90 Angle5G_3_phi90 Power2G_4_tot_th90 Angle5G_3_th90 Power2G_5_phi90
these are strings and I want to use them like.
>> a = who
a =
'Angle2G_1_phi90'
'Angle2G_1_th90'
'Angle2G_1_tot_th90'
'Angle2G_2_phi90'
'Angle2G_2_th90'
'Angle2G_2_tot_th90'
'Angle2G_3_phi90'
'Angle2G_3_th90'
'Angle2G_3_tot_th90'
'Angle2G_4_phi90'
'Angle2G_4_th90'
'Angle2G_4_tot_th90'
'Angle2G_5_phi90'
'Angle2G_5_th90'
'Angle2G_5_tot_th90'
'Angle2G_6_phi90'
'Angle2G_6_th90'
'Angle2G_6_tot_th90'
'Angle5G_2_phi90'
'Angle5G_2_th90'
'Angle5G_2_tot_th90'
'Angle5G_3_phi90'
'Angle5G_3_th90'
'Angle5G_3_tot_th90'
'Angle5G_4_phi90'
'Angle5G_4_th90'
'Angle5G_4_tot_th90'
'Angle5G_5_phi90'
'Angle5G_5_th90'
'Angle5G_5_tot_th90'
'Angle5G_6_phi90'
'Angle5G_6_th90'
'Angle5G_6_tot_th90'
'Power2G_1_phi90'
'Power2G_1_th90'
'Power2G_1_tot_th90'
'Power2G_2_phi90'
'Power2G_2_th90'
'Power2G_2_tot_th90'
'Power2G_3_phi90'
'Power2G_3_th90'
'Power2G_3_tot_th90'
'Power2G_4_phi90'
'Power2G_4_th90'
'Power2G_4_tot_th90'
'Power2G_5_phi90'
'Power2G_5_th90'
'Power2G_5_tot_th90'
'Power2G_6_phi90'
'Power2G_6_th90'
'Power2G_6_tot_th90'
'Power5G_2_phi90'
'Power5G_2_th90'
'Power5G_2_tot_th90'
'Power5G_3_phi90'
'Power5G_3_th90'
'Power5G_3_tot_th90'
'Power5G_4_phi90'
'Power5G_4_th90'
'Power5G_4_tot_th90'
'Power5G_5_phi90'
'Power5G_5_th90'
'Power5G_5_tot_th90'
'Power5G_6_phi90'
'Power5G_6_th90'
'Power5G_6_tot_th90'
>> deleteNaN(a)

回答(1 个)

Walter Roberson
Walter Roberson 2012-5-30

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by