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

3 次查看(过去 30 天)
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 个评论
Stephen23
Stephen23 2022-3-3
"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 2022-3-3
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by