Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Please can anyone clear my doubt regarding Concatenation of data.

1 Ansicht (letzte 30 Tage)
Rakesh Yadav Kodari
Rakesh Yadav Kodari am 21 Feb. 2019
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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.

Antworten (1)

John D'Errico
John D'Errico am 21 Feb. 2019
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.

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by