HOW TO INTERPOLATE MAT 185X250X3 MATRIX USING CUBIC SPLINE
2 views (last 30 days)
Show older comments
Map provides a 185 x 250 x 3 matrix Map representing an image and “image coordinates” xi and yi. interpolation coordinates 5 < x < 180 and 5 < y < 245, both evenly spaced with spacing 0.1. Interpolate each of the 3 blocks of size 185 x 250 of the matrix Map first in one direction, then the other, to produce a 1751 x 2401 x 3 matrix InterpolatedMap. Set any values larger than 1 to 1, and any less than 0 to 0. Use the image command to compare the original image Map to the image in InterpolatedMap.
I have generated code MyCubicInterpolation which works in following way, xi = linspace(-1,1,150); zi = sin((pi.*xi)/2);
x = linspace(-1,1,200);
y = MyCubicSpline(xi,zi,x);
Now I dont understand my which one will be my 1st direction and which one my second direction, should I select entire block Map(:,:,1) out of three. In short I can not understand next steps.
0 Comments
Accepted Answer
Matt J
on 20 Nov 2012
Edited: Matt J
on 20 Nov 2012
It sounds like you're to first interpolate along x to produce an array of size 1751 x 250 x 3 and then interpolate that intermediate result along y to obtain an array of size 1751 x 2401 x 3. Or you can interpolate first along y and then along x. The order won't affect the result.
If you're not sure how to interpret the homework question though, the most reliable person to ask is the one who assigned it to you.
0 Comments
See Also
Categories
Find more on Interpolation 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!