in python language,
so i wanna use string matrix value to matrix name but i couldn't do this. can you tell me how can i use this?

回答 (1 件)

Stephen23
Stephen23 2018 年 5 月 27 日

1 投票

Do not access variable names dynamically, unless you want to force yourself into writing slow, complex, buggy code. Read this to know why:
In MATLAB the simplest solution is to put those vector into one numeric matrix:
M = [ 1, 2, 3, 4;
11,12,13,14;
21,22,23,24];
for R = 1:size(M,1)
for C = 1:size(M,2)
M(R,C)
end
end

1 件のコメント

Jan
Jan 2018 年 5 月 27 日
+1. I cannot vote enough for this answer.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Numeric Types についてさらに検索

質問済み:

2018 年 5 月 27 日

コメント済み:

Jan
2018 年 5 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by