Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Testing if vector x is twice vector y
Date: Thu, 15 Oct 2009 17:12:40 -0400
Organization: The MathWorks, Inc.
Lines: 45
Message-ID: <hb8373$p8$1@fred.mathworks.com>
References: <hb7r2f$8p4$1@fred.mathworks.com> <hb7sg2$d7i$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1255641123 808 172.31.44.65 (15 Oct 2009 21:12:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 Oct 2009 21:12:03 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:577671



"us " <us@neurol.unizh.ch> wrote in message 
news:hb7sg2$d7i$1@fred.mathworks.com...
> "El Hassan Abdel Fattah" <s8ru9@unb.ca> wrote in message 
> <hb7r2f$8p4$1@fred.mathworks.com>...
>> hello all,
>>
>> im a university student and currently im taking a matlab course this 
>> term. i got an assignment due tomorrow and needed some help:
>>
>> if we have two variables:
>>
>> x = [4; 1; 4; 6; 2]
>> y = [3; 9; 2; 3; 1]
>>
>> question is as follows: Test if all the elements of x are twice as big as 
>> the corresponding elements in y OR any element of x is less than the 
>> corresponding element of y.
>>
>> given hint: use the functions 'all( )' and 'any( )' and logic operators 
>> ('|', single vertical bar) for vectors.
>>
>> Thanks for anyones help!!
>>
>> Hassan
>
> a hint:
>
>     help all;
>     help any;
>     help or;
>
> us

Adding on to us's hint:

help lt
help gt

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ