2011-10-25 14 views

cevap

36

bu deneyin:

x = linspace(1, 10, 10); 
n = 3; 
y = x(1 : n : end); % => 1 4 7 10 
y = x(n : n : end); % => 3 6 9 
+1

Adam, bu temiz ve zarif. Güzel çözüm! – jvriesem

-1

Sen görüntülerle benzer yapabilirsiniz.

% load image  
img8=imread('8-bit.png'); 
% downsample 
downSample=img8(1:2:end,1:2:end); 
% upsample 
upSample(1:2:end,1:2:end) = downSample(1:end,1:end)