Opposite of Interpolation: reduce size from a very detailed 2D matrix to a less detailed 2D matrix

11 views (last 30 days)
Hello,
If you look at this link:
You see the "Original Sample" interpolated to the linear interpolation grid. I would like to do just that but exactly opposite. My matrices are 2D but very big files (20GB). I would like to reduce the size but be able to still keep the form of the plots just like in the original sample. Meaning, save bytes but be able to still make some reasonable conclusions about the data.
Anyone have any ideas?

Answers (2)

Star Strider
Star Strider on 16 Apr 2018

You can always interpolate to a coarser grid than the original data.

This uses interp1 for simplicity. The same idea will work for interp2:

x = linspace(0, 10, 100);
y = sin(x * 2);
xi = linspace(0, 10, 33);
yi = interp1(x, y, xi, 'linear','extrap');
figure(1)
plot(x, y, '-b')
hold on
plot(xi, yi, 'pg')
hold off

dpb
dpb on 16 Apr 2018

W/O knowing anything at all about what the data are it's tough to say anything specific but the most obvious is to simply use something like

x=x(1:n:end,1:n:end);

where n=1,2,3,... to decimate. After that, see <smoothing-data>

Categories

Find more on Resizing and Reshaping Matrices 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!