problem using vertcat command in for loop
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, Dear friends
I have a problem using vertcat in for loop command in matlab
I have 30 matixes with several sizes named : filter1 (n,1), filter2 (k,1), filter3 (i,1), ..... , filter30 (r,1)
,that i want to concatenate them in one column with vertcat command
Could any one help me?
2 commentaires
Stephen23
le 5 Mai 2022
Modifié(e) : Stephen23
le 5 Mai 2022
"I have 30 matixes with several sizes named : filter1, filter2, filter3, ..... , filter30"
And that is the start of your problems.
"that i want to concatenate them in one column with vertcat command"
That would be easy if you had stored your data in one cell array instead of thirty separate variables.
Then you could simply do this:
V = vertcat(C{:})
"Could any one help me?"
The best place to fix this is when you get them into the workspace: are the LOADed from files?
Jon
le 5 Mai 2022
Modifié(e) : Jon
le 5 Mai 2022
Probably is an issue with the dimension of you matrices not being compatible for vertical concatentation. They all need to have the same number of columns. Hard to tell the exact problem though without seeing the specifcs of what you are trying to do. Please attach a self contained example of your code you have that produces the problem and the full text of the error message(s) you are getting
Réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!