Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Testing if vector x is twice vector y
Date: Thu, 15 Oct 2009 19:17:22 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 25
Message-ID: <hb7sg2$d7i$1@fred.mathworks.com>
References: <hb7r2f$8p4$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255634242 13554 172.30.248.37 (15 Oct 2009 19:17:22 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 Oct 2009 19:17:22 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:577647


"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