Extracting and using the values of variables in workspace in a loop

Hi everyone. I am new to MATLAB and need a help.
I have a LARGE amount of data stored as matrices of different sizes. I have loaded them in the workspace and now need to manipulate them (particularly use integration). I was wondering if anyone knows of a way to extract the values of the variables in workspace in a loop (one by one, or in a certain sequence). All I could do was to use a function "who" but it only gives the names of the variables and if I say type:
a=who; a(1);
it gives me the name of the variable, while i need to work with the matrix itself.

回答 (2 件)

Matt Fig
Matt Fig 2011 年 6 月 2 日

0 投票

clear all
x = 1:10;
y = 4;
a = whos;
eval(a(1).name)
eval(a(2).name)
But what is it that you are really wanting to accomplish? There must be a way to do what you want to do without such wizardry...

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2011 年 6 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by