Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Indexing an an array

1 Ansicht (letzte 30 Tage)
Keihan
Keihan am 25 Apr. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
Stephen23
Stephen23 am 25 Apr. 2018
Bearbeitet: Stephen23 am 25 Apr. 2018
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:

Antworten (0)

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by