how to change matrix dimensions?

2 views (last 30 days)
lina on 23 May 2014
Commented: Image Analyst on 24 May 2014
hi all
how can i change the matrix dimension from 312*1 to 276*1
thank you

Sign in to comment.

Accepted Answer

Mahdi on 23 May 2014
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:
Where B is the matrix containing the data from 1984 to 2006 if the year 2006 ends at the 276th row.
Image Analyst
Image Analyst on 24 May 2014
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.

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 23 May 2014
Try interp2() or (much, much easier) try imresize() if you have the Image Processing Toolbox.


Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by