From: Satish on
I need to use an argument such that there are nearly 3 arguments of which if any one is satisfied then the following calculation should take place. I Use OR function in excel/VB and know that we could use eleseif statement in matlab script file. But do we have something like OR in matlab as well which could be easily used. I need to write a script file for the cal;culations and hence OR could come really handy.

Thanks
From: Oleg Komarov on
"Satish " <satish_vasco(a)yahoo.co.in> wrote in message <hlllj6$5pr$1(a)fred.mathworks.com>...
> I need to use an argument such that there are nearly 3 arguments of which if any one is satisfied then the following calculation should take place. I Use OR function in excel/VB and know that we could use eleseif statement in matlab script file. But do we have something like OR in matlab as well which could be easily used. I need to write a script file for the cal;culations and hence OR could come really handy.
>
> Thanks
Yes but it doesn't work as excels OR(cond1, cond2, cond3).

cond1 = state1 == x;
cond2 = state2 > X;
cond3 = state3 < x;

if con1 || cond2 || cond3
% do stuff
else
....
end

For additional information lookfor "logical operators"

Oleg
From: Satish on
"Oleg Komarov" <oleg.komarovRemove.this(a)hotmail.it> wrote in message <hllnbb$s7f$1(a)fred.mathworks.com>...
> "Satish " <satish_vasco(a)yahoo.co.in> wrote in message <hlllj6$5pr$1(a)fred.mathworks.com>...
> > I need to use an argument such that there are nearly 3 arguments of which if any one is satisfied then the following calculation should take place. I Use OR function in excel/VB and know that we could use eleseif statement in matlab script file. But do we have something like OR in matlab as well which could be easily used. I need to write a script file for the cal;culations and hence OR could come really handy.
> >
> > Thanks
> Yes but it doesn't work as excels OR(cond1, cond2, cond3).
>
> cond1 = state1 == x;
> cond2 = state2 > X;
> cond3 = state3 < x;
>
> if con1 || cond2 || cond3
> % do stuff
> else
> ...
> end
>
> For additional information lookfor "logical operators"
>
> Oleg

Thanks Oleg, will check up as you say.
 | 
Pages: 1
Prev: KDD Cup data set
Next: Simulink model settings