How to store multiple for loop variables separately ?

for i = 1:4 ; Vmi=[X(i),Z(i)]; end I have X=[10 14 8] & Y=[45 7 63] how to store Vm1..Vm4 as separate variables for eg Vm1=[10 45];

1 件のコメント

Stephen23
Stephen23 2018 年 3 月 9 日
Dynamically accessing variable names is how beginners force themselves into writing slow, complex, buggy code that is hard to debug. Read this to know more:
In contrast indexing is simple, neat, easy to debug, and very efficient. You can easily use indexing to access your matrix, so why not do that?

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeParallel Computing についてさらに検索

タグ

質問済み:

2018 年 3 月 9 日

コメント済み:

2018 年 3 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by