help-octave
[Top][All Lists]
Advanced

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

Re: Avoid loop


From: Kai Torben Ohlhus
Subject: Re: Avoid loop
Date: Tue, 5 Feb 2019 14:55:19 +0100

On Mon, Feb 4, 2019 at 7:34 AM LucaLuca <address@hidden> wrote:
hi,
look this piece of code :

  for gg=rowss:roww
                 v1=E(gg,Col)>maxRel;

                 maxRel=max(E(gg,Col),maxRel);
                 minRel=!v1.*minRel+v1*9999999999999999999999;

                 minRel=min(E(gg,Col),minRel);
                 diff=maxRel-minRel;
                 rangeRel=max(diff,rangeRel);
  endfor

it's possible to avoid loop? (i'm refer to : for gg=rowss:roww)


Please provide a more complete example (without undefined values) and
use https://pastebin.com/ or alike to share bigger code snippets.
In general your *Rel variables can be vectors and this might speed up things.

Best,
Kai 

reply via email to

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