Expanding a matrix using interpolation?
Mostrar comentarios más antiguos
Hi everyone,
I have a 7X5 matrix called "Temperatures", and I was wondering if I could interpolate these values it both directions to get a better 2D temperature gradient graph?
This are the values in my matrix:

And using ">> imagesc(Temperatures)" I get something like this

Is it possible to interpolate this matrix to obtain a better temperature gradient graph?
Thank you!
Respuesta aceptada
Más respuestas (1)
Ameer Hamza
el 29 de Abr. de 2018
Editada: Ameer Hamza
el 29 de Abr. de 2018
newNumberOfRows = 10; % set the number of rows interpolated rows you want
newNumberOfCols = 5; % set the number of columns interpolated rows you want
[x, y] = meshgrid(1:size(A,2), 1:size(A,1));
[xq, yq] = meshgrid(linspace(1, size(A, 2), newNumberOfCols), linspace(1, size(A, 1), newNumberOfRows));
newMatrix = interp2(x, y, A, xq, yq)
1 comentario
Claudio Duarte Silva
el 29 de Abr. de 2018
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

