problem using vertcat command in for loop
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
Stephen23
2022-5-5
编辑:Stephen23
2022-5-5
"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
2022-5-5
编辑:Jon
2022-5-5
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
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!