Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Indexing an an array

2 vues (au cours des 30 derniers jours)
Keihan
Keihan le 25 Avr 2018
Clôturé : MATLAB Answer Bot le 20 Août 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 commentaire
Stephen23
Stephen23 le 25 Avr 2018
Modifié(e) : Stephen23 le 25 Avr 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:

Réponses (0)

Cette question est clôturée.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by