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

조회 수: 3 (최근 30일)
niniki
niniki 2022년 3월 3일
댓글: niniki 2022년 3월 3일
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