Borrar filtros
Borrar filtros

Define an array with variable

2 visualizaciones (últimos 30 días)
C Zeng
C Zeng el 29 de Abr. de 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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 29 de Abr. de 2013
k=4
assignin('base',sprintf('x_%d',k),[1 2 3])

Categorías

Más información sobre Automotive en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by