Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: strange error message
Date: Fri, 18 Sep 2009 05:01:04 +0000 (UTC)
Organization: Boeing
Lines: 19
Message-ID: <h8v46g$cmt$1@fred.mathworks.com>
References: <ec15a73f-76ad-4291-a568-b615d121e464@v36g2000yqv.googlegroups.com> <45341af6-364d-45e0-bcc2-3536c8ae52fe@g6g2000vbr.googlegroups.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 1253250064 13021 172.30.248.37 (18 Sep 2009 05:01:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 18 Sep 2009 05:01:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:571253


SaintPatrick <patrickmyu@gmail.com> wrote in message <45341af6-364d-45e0-bcc2-3536c8ae52fe@g6g2000vbr.googlegroups.com>...
> 
> I don't understand -- z shows up in the workspace as a matrix with the
> same dimensions as x and y.  Since t is a matrix, z = sin(t) should
> also be a matrix.

>> t=0:0.01:2*pi;s=t;
>> x=cos(t).*cos(s);y=cos(t).*sin(s);z=sin(t);
>> whos
  Name      Size                    Bytes  Class
  s         1x629                    5032  double array
  t         1x629                    5032  double array
  x         1x629                    5032  double array
  y         1x629                    5032  double array
  z         1x629                    5032  double array

So why do you think t and z should be matrices? Clearly t is a vector, and z is a vector also because it is sin of a vector.

James Tursa