On Tue, Jun 29, 2010 at 11:38 AM, octave_user <

[hidden email]> wrote:

>

> Hi!

> I created a function in Matlab, which has a problem. The code is the

> following:

>

> ==============

> for i=1:m

> for j=1:n

> for jj=1:m

> if x(j)<tresholdX(jj) & y(j)<tresholdY(jj)

> ET=[ET; i j];

> break

> end

> end

> end

> end

You can use an extra control variable tested in the outer loops, or

make this a function and use return.

Of course, an even much better idea is to get rid of the loops

completely and use array masks and find instead.

--

RNDr. Jaroslav Hajek, PhD

computing expert & GNU Octave developer

Aeronautical Research and Test Institute (VZLU)

Prague, Czech Republic

url: www.highegg.matfyz.cz

_______________________________________________

Help-octave mailing list

[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave