how to change matrix dimensions?
2 ビュー (過去 30 日間)
古いコメントを表示
hi all
how can i change the matrix dimension from 312*1 to 276*1
thank you
4 件のコメント
Mahdi
2014 年 5 月 23 日
Do you know which index that the year 2006 corresponds to in the second matrix? (Where does the data stop for 2006?) Similarly, does your matrix tell you which year corresponds to which data point?
採用された回答
Mahdi
2014 年 5 月 23 日
Based on what you told me, let's say that the data for the years 1984-2009 is stored in matrix A, you would simply do:
B=A(1:276,1);
Where B is the matrix containing the data from 1984 to 2006 if the year 2006 ends at the 276th row.
4 件のコメント
Image Analyst
2014 年 5 月 24 日
By the way, you're not changing the dimension of your matrix. What's you're doing is extracting a portion of A into a new matrix B. Nothing got changed.
その他の回答 (1 件)
Image Analyst
2014 年 5 月 23 日
Try interp2() or (much, much easier) try imresize() if you have the Image Processing Toolbox.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!