help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nearest neighbor interpolation.


From: Francesco Potortì
Subject: Re: Nearest neighbor interpolation.
Date: Fri, 20 Apr 2012 13:09:08 +0200

>> I can suggest to reduce the two for-loops to one to make it faster:
>
>Forget the single for-loop, it's even easier than that, you only need:
>
>b(1:2:end,1:2:end) = a;
>
>Period; no for-loops, no interpolation, life it's sometimes easier than 
>it looks like...

It would be good programming practice to initialize b beforehand:

b = zeros (size (a));

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.315.3058 (op.2111)
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Fax:    +39.050.315.2040  
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it


reply via email to

[Prev in Thread] Current Thread [Next in Thread]