Re: Conditions in If sats true one each bUT NOT SIMULTANEOUSLY




"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


.



Relevant Pages

  • Re: Conditional Formatting With Grades
    ... Say your grades ... First Condition ... Second Condition ... Third Condition ...
    (microsoft.public.excel.worksheet.functions)
  • Re: using 2 If statements
    ... I am using Verilog-a.. ... They are evaluated in sequence. ... In fact if the first condition in the first if state is false, the second condition isn't evaluated either. ...
    (comp.lang.verilog)
  • CountIF formula
    ... I need to run a countif formula, with 2 conditions on two different ... columns, The first condition is that column D matches cell A1, ... the second condition is that column K is greater than 0. ...
    (microsoft.public.excel)
  • Re: conditions in Excel
    ... Assume the first condition is not met then you say you ... Frank Kabel ... Peter L wrote:> Hi Frank and thanks for your answer> If it not too mutch trubble I would like to have both a worksheet> formula or a VBA solution? ... > In your answer you wrote that:"your first and second condition are> identical but you want different ...
    (microsoft.public.excel.programming)