Reshaping a matrix using a loop or any function inbuilt.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Jan
am 21 Mär. 2013
Bearbeitet: Jan
am 21 Mär. 2013
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.
2 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!