Combining Matrices
4 次查看(过去 30 天)
显示 更早的评论
hello im Ahmat i have encountered a problem it is related to the this one http://www.mathworks.com/matlabcentral/answers/13101-combine-many-matrices-into-one
but my problem is different i have A1,A2...An matrices and i want to combine them as B=[A1;A2;..;An] how can i do that in a loop or something(i have to do in in a loop )
ex A1=[2 3];A2=[4 5];A3=[5 6]; B=[2 3;4 5;5 6]
thanks
0 个评论
回答(2 个)
Fangjun Jiang
2011-10-10
Hope it's not too late. The better approach is not to name your variable as A1, A2, A3. This problem has been asked numerous times on this forum.
3 个评论
Fangjun Jiang
2011-10-11
The point is, if the data is not named as A1, A2, A3, you don't need to combine them at all. Are you taking the data from somewhere else, or the data is created by you?
Walter Roberson
2011-10-11
Read the FAQ in reverse. If the FAQ tells you how to assign to variable names in a loop, then by flipping the statements around, it also tells you how to retrieve from variable names in a loop.
另请参阅
类别
在 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!