From: Ganesh on
Here is a newbie to 2D interpolation and this is a real simple to most of you. I have 2D data acquired at 0.5 cm intervals in both x&y axes with size 65x53. All I wanted to do is use cubic or cubic spline to get them at 0.1 cm intervals, to make them look nice on a
plot that needs 1mm spatial resolution.
When I used, ZI = interp2(Z,ntimes) with ntimes=5 for a 65x53 matrix, the final matrix size of ZI was 2049x1665. How come? Is Interp2 the right tool and is this the correct way to use it? What should be the size of the final data set ?
Thanks!
From: Matt J on
"Ganesh " <nganesh76(a)hotmail.com> wrote in message <i36q5s$raa$1(a)fred.mathworks.com>...
> Here is a newbie to 2D interpolation and this is a real simple to most of you. I have 2D data acquired at 0.5 cm intervals in both x&y axes with size 65x53. All I wanted to do is use cubic or cubic spline to get them at 0.1 cm intervals, to make them look nice on a
> plot that needs 1mm spatial resolution.
> When I used, ZI = interp2(Z,ntimes) with ntimes=5 for a 65x53 matrix, the final matrix size of ZI was 2049x1665. How come? Is Interp2 the right tool and is this the correct way to use it? What should be the size of the final data set ?
===========

ntimes=5 is not the upsampling factor. It means the upsampling factor will be 2^ntimes=32
From: Ganesh on
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <i36rda$igf$1(a)fred.mathworks.com>...
> ntimes=5 is not the upsampling factor. It means the upsampling factor will be 2^ntimes=32

Thanks for the clarification. Which command shall I use to interpolate 0.5cm separated 2D rectangular grid data into 0.1cm separated grid.
Thank you!
From: Matt J on


Call interp2 in 5-argument form,

interp2(1:65, 1:53, Z, 1:0.2:65, 1:0.2:53)
From: Ganesh on
Lets say my rectangular grid is called A of size(65,53) & type double. I am looking to make it into a larger matrix with separation 0.1cm instead of 0.5 cm and call this as matrix B. Can you help me in using the interp2 command now? What is Z in your command? I tried it but in vain.

B=interp2(A,1:0.1:65,1:0.1:53);
??? Error using ==> interp2 at 147
XI and YI must be the same size or vectors of different orientations.

Thank you!

"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <i37000$fda$1(a)fred.mathworks.com>...
>
>
> Call interp2 in 5-argument form,
>
> interp2(1:65, 1:53, Z, 1:0.2:65, 1:0.2:53)
 |  Next  |  Last
Pages: 1 2
Prev: xlsread Color of Cells
Next: electron Gun