Save values of a matrix after each iteration in a new matrix
2 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I am a newbie to MATLAB. I am writing a code where I need to save values of a matrix in a new matrix each time loop ends. Say for example I have a FOR loop and let's assume loop runs from 1 to 3 and after each iteration,FOR loop gives us a new matrix. Is it possible to store those arrays or matrix we get after each iteration and place them in a new matrix? I am really stuck..need your help guys..
Thanks !!
0 个评论
采纳的回答
Sean de Wolski
2015-2-9
Typically one would stick the new matrices in the third dimension of the first or in a cell array.
For the 3d case, you would end up with an mxnxp matrix where each slice A(:,:,mat) is the corresponding matrix. If you give us an example of what you have, we can critique.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!