Reshaping a matrix using a loop or any function inbuilt.
1 次查看(过去 30 天)
显示 更早的评论
Hello, Does anyone know how to reshape a m*n matrix into m*1*n matrix using loops or any other function. I would definitely appriciate if both the methods are illustrated.
0 个评论
采纳的回答
Jan
2013-3-21
编辑:Jan
2013-3-21
x = rand(3,4);
y = reshape(x, 3, 1, 4);
size(y)
This is such efficient, that it is hard to dare to do this in a loop. Therefore I assume, that the problem is a homework question and to avoid cheating, I ask you to post, what you have done so far to solve it with a loop. Then ask a specific question to the occurring problems.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!