|
From: | Doug Stewart |
Subject: | Re: Nearest neighbor interpolation. |
Date: | Fri, 20 Apr 2012 07:26:07 -0400 |
>> I can suggest to reduce the two for-loops to one to make it faster:It would be good programming practice to initialize b beforehand:
>
>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...
b = zeros (size (a));
--
[Prev in Thread] | Current Thread | [Next in Thread] |