From: Danielle Leblanc on
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
"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
>> 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
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.