Double = in one line of code
1 回表示 (過去 30 日間)
古いコメントを表示
Can I define a=b=c in one line of code in matlab? if yes what is the syntax?
I do not want to define in double section like a=b; c=b;
回答 (2 件)
Andrei Bobrov
2019 年 8 月 13 日
b = 1000;
zz = {b};
[a,c] = zz{[1,1]};
1 件のコメント
Rik
2019 年 8 月 13 日
Nice hack, although I think deal is more clear when reading the code. I didn't know this syntax also generated a comma-separated list like {:} does.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!