Prev: Can MATLAB send a Mac email?
Next: structure recursion
From: Danielle Leblanc on 8 Jul 2010 09:21 I have a vector c 24x1 I want to say if all elements of C are greater than 35 then do the regression. is: if C>35 S=regstats2(Y,X) end a correct statement?
From: Andy on 8 Jul 2010 09:46 "Danielle Leblanc" <danielleblanc2004(a)hotmail.com> wrote in message <i14jc0$itb$1(a)fred.mathworks.com>... > I have a vector c 24x1 > > I want to say if all elements of C are greater than 35 then do the regression. is: > > if C>35 > S=regstats2(Y,X) > end > > a correct statement? Yes, that should work. Are you getting some error?
From: Matt Fig on 8 Jul 2010 09:46 >> C = [2;1;2]; if C>2,disp('In if');end >> C = [2;1;2]; if C>1,disp('In if');end >> C = [2;1;2]; if C>0,disp('In if');end In if
From: Walter Roberson on 8 Jul 2010 10:16 Danielle Leblanc wrote: > I have a vector c 24x1 > > I want to say if all elements of C are greater than 35 then do the > regression. is: > > if C>35 > S=regstats2(Y,X) > end > > a correct statement? If you have to ask now about whether it is a correct statement, then you should expect that other people who read it will also have doubts about its correctness. It does turn out to be a correct statement, but it also turns out not to be a good statement. I would suggest you modify the test to, if all(C>35) and then readers will know exactly what it means without hesitation.
|
Pages: 1 Prev: Can MATLAB send a Mac email? Next: structure recursion |