Change dimensions of 2d data

I have a 2d matrix of size 3281*3164 with pixel size 0.009 , I want to convert it to size 2987*2880 with pixel size 0.01. Can anyone help?

Respuestas (1)

Mohammad Sami
Mohammad Sami el 3 de Jun. de 2020

0 votos

You can use the imresize function to scale the image up or down.
a = rand(3281,3164);
b = imresize(a,0.91024);

3 comentarios

Avinash Nunna
Avinash Nunna el 3 de Jun. de 2020
I think it works for these dimension .What If i have some other dimensions, how to get the value for resizing?
darova
darova el 13 de Jun. de 2020
maybe interp2?
Mohammad Sami
Mohammad Sami el 15 de Jun. de 2020
Editada: Mohammad Sami el 15 de Jun. de 2020
Im resize support both scale factor and absolute size.
a = rand(3281,3164);
b = imresize(a,[2987 2880]);

Iniciar sesión para comentar.

Categorías

Más información sobre Read, Write, and Modify Image en Centro de ayuda y File Exchange.

Preguntada:

el 3 de Jun. de 2020

Editada:

el 15 de Jun. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by