Effacer les filtres
Effacer les filtres

Define an array with variable

2 vues (au cours des 30 derniers jours)
C Zeng
C Zeng le 29 Avr 2013
Hello, I wonder how can I define an array with a variable, for example,
x_i=an array, where i changes. I do not think Matlab allows such operations. How can I accommodate it? Later on I will use x_i in loops.
Thanks.

Réponse acceptée

Sean de Wolski
Sean de Wolski le 29 Avr 2013
  5 commentaires
Sean de Wolski
Sean de Wolski le 29 Avr 2013
Yes, I do. You may find this Webinar helpful:
C Zeng
C Zeng le 30 Avr 2013
Oh, great! Thanks so much!

Connectez-vous pour commenter.

Plus de réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 29 Avr 2013
k=4
assignin('base',sprintf('x_%d',k),[1 2 3])
  1 commentaire
C Zeng
C Zeng le 29 Avr 2013
Thanks.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Automotive dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by