Adding additional points to matrix image
4 views (last 30 days)
Show older comments
Hallo,
I have a matrix called my_data and unfortunately the data points are sparse and they produce the following image:
How can I edit the matrix to produce a smooth curve? I have tried interp2 and pcolor with shading interp but the points are still not jointed.
Here is the code I have found on the Internet and edited to suit my application
[A,B] = meshgrid(1:size(my_data,2), 1:size(my_data,1));
[A2,B2] = meshgrid(1:0.01:size(my_data,2), 1:0.01:size(my_data,1));
interped = interp2(A, B, my_data, A2, B2, 'linear');
imagesc(interped)
2 Comments
Answers (0)
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!