help-octave
[Top][All Lists]
Advanced

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

Re: Nearest neighbor interpolation.


From: Doug Stewart
Subject: Re: Nearest neighbor interpolation.
Date: Fri, 20 Apr 2012 07:26:07 -0400



On Fri, Apr 20, 2012 at 7:09 AM, Francesco Potortì <address@hidden> wrote:
>> 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));

--
should this be

b=zeros(size(a).*2 -1) 


--
DAS

https://linuxcounter.net/user/206392.html

reply via email to

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