problem using vertcat command in for loop
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Stephen23
il 5 Mag 2022
Modificato: Stephen23
il 5 Mag 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
il 5 Mag 2022
Modificato: Jon
il 5 Mag 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
Risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!