Re: Conditions in If sats true one each bUT NOT SIMULTANEOUSLY
- From: "Steven Lord" <slord@xxxxxxxxxxxxx>
- Date: Wed, 16 Dec 2009 09:06:07 -0500
"Hanna " <hannala@xxxxxx> wrote in message
news:hgaopr$o3g$1@xxxxxxxxxxxxxxxxxxxxx
Hi,
I have an if sats with three statements. All statements are true one each
but not simultaneously.
Here is the If statement with the three conditions:
if isnan(coups(ii,dd)) && isempty(mats(ii,dd))==0 &&
isnan(mats(ii,dd))==0;
I have tested both & and && but note of them is working. Any ideas?
Yes -- it sounds like you don't want this IF statement to be true only in
the case where the first condition AND the second condition AND the third
condition are all true simultaneously. If you're looking for this IF
statement to be true if the first condition OR the second condition OR the
third condition are true, use | or || instead of & or &&.
If that's not what you want to happen, describe in more detail SPECIFICALLY
what you want this IF statement to do and when you want the IF to be true.
--
Steve Lord
slord@xxxxxxxxxxxxx
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
.
- References:
- Prev by Date: Vectorizing two loops for forming of pairs
- Next by Date: Re: i Matlab 2009bnstall error
- Previous by thread: Conditions in If sats true one each bUT NOT SIMULTANEOUSLY
- Next by thread: Re: Conditions in If sats true one each bUT NOT SIMULTANEOUSLY
- Index(es):
Relevant Pages
|