フィルターのクリア

dynamic naming using eval(.)

1 回表示 (過去 30 日間)
xplore29
xplore29 2013 年 3 月 26 日
I am creating new matrices in a loop
IP = IP_count(:);
x=IP_count_length;
for i=1:IP_count_length
eval(['FBSeq' num2str(i) '_Table' '=BinaryCombination(IP(i))'])
end
//FBSeq1_Table;
//FBSeq2_Table;
.
.
.
//FBSeqx_Table
% Binary combination function just computes all possible binary combinations of length (IP(i))
These matrices are of different dimensions. Now I want to pass these newly created matrices to a function.
How can I do this task. Moreover how can I perform processing of particular row/col of any of these matrices later on. Since I have used dynamic naming of these matrices , I dont know how can I call them

採用された回答

James Tursa
James Tursa 2013 年 3 月 26 日
I would advise using a cell array instead. E.g.,
IP = IP_count(:);
x = IP_count_length;
FB = cell(1,IP_count_length);
for i=1:IP_count_length
FB{i} = BinaryCombination(IP(i));
end
Then you can just pass FB to your function.

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 3 月 26 日

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by