Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Please can anyone clear my doubt regarding Concatenation of data.

조회 수: 1 (최근 30일)
Rakesh Yadav Kodari
Rakesh Yadav Kodari 2019년 2월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
I came to know dynamic variables are bad idea. But i have a small doubt regarding Concatenation of data.
Suppose if i have data like A1,A2.....AN
and if I use strcat to Concatenatie data do i really need to type in all the variable in the work space
Like s = strcat(A1,A2,....AN) or can i say From A1 to AN ?
Thanks in Advance.

답변 (1개)

John D'Errico
John D'Errico 2019년 2월 21일
Sorry, but there are soooo many reasons why you do not want to create those numbered variables. Having now done so however, you still cannot just do something like "From A1 to AN". MATLAB does not support such an operation.
You need to convert your variables into an array. Learn to use arrays instead. I'm sorry. But just suck it up and get yourself out of the hole you climbed into. You can start over, creating an array, as you should have done in the beginning. Or you can type all those variable names. Hey, it is just once. It builds character. Or, you can dig even more deeply into that rabbit hole, finding a way to work with all those variables, perhaps still using eval. Good luck if you do that, if you choose to make the descent into programming hell. Better for you to simply climb out before the hole gets too deep.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by