How to index a variable value and assign it to an array?

12 visualizaciones (últimos 30 días)
Carly Hudson
Carly Hudson el 16 de Abr. de 2020
Respondida: the cyclist el 16 de Abr. de 2020
I am a beginner in MatLab and I am trying to assign a variable value to an array.
Ex:
d1 = 579
y = array(d1)
I know I can just input the number into the array, but I want to extract the value from the variable just in case d1 changes.
  1 comentario
the cyclist
the cyclist el 16 de Abr. de 2020
It seems that you are not just a beginner, but you have really spent almost no time learning even the most basic operations of MATLAB. I would recommend viewing a tutorial such as the MATLAB Onramp.

Iniciar sesión para comentar.

Respuestas (1)

the cyclist
the cyclist el 16 de Abr. de 2020
Do you mean simply
y = d1
If not, can you give a more specific example of the input and output you would expect (not just a pretend syntax that does not work)?

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by