Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Indexing an an array

1 回表示 (過去 30 日間)
Keihan
Keihan 2018 年 4 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have n arrays with different lengths. I want to index these n arrays in a for loop. How do I index n arrays of different lengths from 1 to n?
Thank you.
  1 件のコメント
Stephen23
Stephen23 2018 年 4 月 25 日
編集済み: Stephen23 2018 年 4 月 25 日
Simple: put them into a cell array, and then use an index. Indexing is neat, very efficient, and easy to debug.
Whatever you do, do NOT try to magically access the variable names in a loop. Dynamically accessing variable names in a loop is slow, complex, buggy, and hard to debug. Read more here:

回答 (0 件)

この質問は閉じられています。

製品

Community Treasure Hunt

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

Start Hunting!

Translated by