Simple Matlab Operation
4 ビュー (過去 30 日間)
古いコメントを表示
Hi Guys! I have a noob question, that was bothering me. Let's say I have three variables: Var1=0, Var2=0, Var3=0. I also have another one - Var4=[1 2 3]
Is it possible to write this code in one row:
Var1=Var4(1);
Var2=Var4(2);
Var3=Var4(3);
Like it would be very useful if I could use something like this:
[Var1, Var2, Var3]=Var4(:);
0 件のコメント
採用された回答
Andrei Bobrov
2011 年 6 月 30 日
Var4 = num2cell([1 2 3])
[Var1, Var2, Var3]=Var4{:};
BUT it's don't useful
4 件のコメント
Matt Fig
2011 年 6 月 30 日
http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Calendar についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!