Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Please can anyone clear my doubt regarding Concatenation of data.

1 vue (au cours des 30 derniers jours)
Rakesh Yadav Kodari
Rakesh Yadav Kodari le 21 Fév 2019
Clôturé : MATLAB Answer Bot le 20 Août 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.

Réponses (1)

John D'Errico
John D'Errico le 21 Fév 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.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by