how to write a1=1;a2=2;a3=3; from A

3 ビュー (過去 30 日間)
Prabha Kumaresan
Prabha Kumaresan 2018 年 1 月 3 日
編集済み: Stephen23 2018 年 1 月 3 日
if A=1:1000
how to write a1=1;a2=2;a3=3;.......a1000=1000; from A

採用された回答

Stephen23
Stephen23 2018 年 1 月 3 日
編集済み: Stephen23 2018 年 1 月 3 日
Do NOT do this
This would actually be horribly slow, pointlessly complex, obfuscated, and very buggy way to write your code. You would make your code hard to debug, and a pain to work with. Read this to know why:
Using indexing would be simple, neat, and very efficient. You should use one array and indexing. Indexing is the solution you should be using, because it is the most efficient way to write MATLAB code, is simple, neat, and very easy to debug. Indexing is explained quite well in the MATLAB introductory tutorials, which are highly recommended for all beginners:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by