Borrar filtros
Borrar filtros

how to change matrix dimensions?

5 visualizaciones (últimos 30 días)
lina
lina el 23 de Mayo de 2014
Comentada: Image Analyst el 24 de Mayo de 2014
hi all
how can i change the matrix dimension from 312*1 to 276*1
thank you
  4 comentarios
Mahdi
Mahdi el 23 de Mayo de 2014
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?
lina
lina el 23 de Mayo de 2014
no it doesnt

Iniciar sesión para comentar.

Respuesta aceptada

Mahdi
Mahdi el 23 de Mayo de 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:
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 comentarios
lina
lina el 23 de Mayo de 2014
THANK YOU very much
Image Analyst
Image Analyst el 24 de Mayo de 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.

Iniciar sesión para comentar.

Más respuestas (1)

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

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by