How do you store each row of text in a 7x1 array sequentially in a variable?

2 visualizaciones (últimos 30 días)
How do you store each row of text in a 7x1 array sequentially in a variable?
D =
7x1 cell array
a
b
c
d
e
f
g
--->
data1 = a
data2 = b
data3 = c
data4 = d
data5 = e
data6 = f
data7 = g
I want to declare the variables sequentially and store the elements of each row of the 'D' variable in them.
I was going to use a function called eval, but it's not recommended, so tell me another way.
  4 comentarios
Stephen23
Stephen23 el 3 de Mzo. de 2022
"How do you store each row of text in a 7x1 array sequentially in a variable?"
I don't. Because MATLAB is designed to work efficiently with arrays. So I use arrays. You should use arrays too.
It is very unlikely that you need to do this, or that it would be a good way to achieve your data-processing goal.
But because you made this mistake:
we can't really help you much (in any case, the solution will be to use arrays, indexing, etc.).
niniki
niniki el 3 de Mzo. de 2022
Thank you to everyone who gave me their opinions.
As you said, I saved it in the cell arrangement and solved it by bringing it up. Thank you.

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by