May 17, 2005 #1 D davyzhu Advanced Member level 1 Joined May 23, 2004 Messages 494 Helped 5 Reputation 10 Reaction score 2 Trophy points 1,298 Location oriental Activity points 4,436 Hello all, How to do "if (x==1 && y==0)" in Matlab, the "if (x==1 && y==0)" is in C. Thanks! Davy
May 17, 2005 #2 cedance Advanced Member level 2 Joined Oct 24, 2003 Messages 551 Helped 30 Reputation 60 Reaction score 7 Trophy points 1,298 Location Germany Activity points 4,622 hi, see the matlab documentation.. u could see the matlab help for these sort of things.. or type "help if" in the command window and u would get it known from there... nyways, the command is, if ( a ==b & c ==d ) command........ end also see here: /http://www-ccs.ucsd.edu/matlab/techdoc/ref/if.html /cedance
hi, see the matlab documentation.. u could see the matlab help for these sort of things.. or type "help if" in the command window and u would get it known from there... nyways, the command is, if ( a ==b & c ==d ) command........ end also see here: /http://www-ccs.ucsd.edu/matlab/techdoc/ref/if.html /cedance
May 17, 2005 #3 E Element_115 Advanced Member level 2 Joined Mar 23, 2002 Messages 508 Helped 72 Reputation 144 Reaction score 43 Trophy points 1,308 Activity points 3,755 In Matlab always use the help command it's a good tool to have! help if help & This should help you in the future! As for you question. if (x==1 & y==0); That works Peace
In Matlab always use the help command it's a good tool to have! help if help & This should help you in the future! As for you question. if (x==1 & y==0); That works Peace
May 20, 2005 #4 B btwang Newbie level 5 Joined Mar 10, 2005 Messages 9 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,283 Activity points 1,346 it should be "if(x==1&y==0)"in matlab
May 20, 2005 #5 YUV Advanced Member level 4 Joined Sep 26, 2002 Messages 114 Helped 12 Reputation 24 Reaction score 3 Trophy points 1,298 Location Ukraine Activity points 1,191 davyzhu said: Hello all, How to do "if (x==1 && y==0)" in Matlab, the "if (x==1 && y==0)" is in C. Thanks! Davy Click to expand... If I were you, I would add extra round brackets if ((x==1) & (y==0)) to be sure in order of operations. Also, it's much better readable.
davyzhu said: Hello all, How to do "if (x==1 && y==0)" in Matlab, the "if (x==1 && y==0)" is in C. Thanks! Davy Click to expand... If I were you, I would add extra round brackets if ((x==1) & (y==0)) to be sure in order of operations. Also, it's much better readable.