How to code my own Reshape function without using the built in reshape()??
11 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
James Tursa
2020 年 10 月 16 日
編集済み: James Tursa
2020 年 10 月 16 日
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.
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!