How to code my own Reshape function without using the built in reshape()??
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Coleman tyson
el 16 de Oct. de 2020
Im essentially trying to make a function ---> function [matrix] = myReshape(vector, m, n) that takes in a 1d vector and dimensions m and n, and makes it a 2d matrix as shown above with the m and n provided.
How can I go about this?
2 comentarios
James Tursa
el 16 de Oct. de 2020
Editada: James Tursa
el 16 de Oct. de 2020
Since MATLAB stores values in column order, note that your proposed "reshape" reorders the values in memory. I.e., it does not do the same thing as the MATLAB reshape( ) function. You have the equivalent of a transpose mixed in with this operation.
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!