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
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.).
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!