problem using vertcat command in for loop
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Stephen23
am 5 Mai 2022
Bearbeitet: Stephen23
am 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
am 5 Mai 2022
Bearbeitet: Jon
am 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
Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!