Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: get a 1d vector from a multidimensional array
Date: Sun, 9 Sep 2007 20:56:14 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 67
Message-ID: <fc1mle$ds5$1@fred.mathworks.com>
References: <fc1le7$449$1@fred.mathworks.com> <fc1m29$upv$1@aioe.org>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1189371374 14213 172.30.248.36 (9 Sep 2007 20:56:14 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 9 Sep 2007 20:56:14 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:427573



ummm no not really, that is how it usually works, but this
is not giving me a 1d thing back , it is giving me a 3d
thing, thats what i'm trying to avoid.

David


dpb <none@non.net> wrote in message <fc1m29$upv$1@aioe.org>...
> David Doria wrote:
> > i have an array that i index with 3 numbers, ie:
> > 
> > Normalized_Moment_Values(1, 1, 1) returns a double
> > 
> > However, I want all the things that correspond to (1,1,x),
> > so i usually do
> > 
> > Normalized_Moment_Values(1, 1, :)
> > 
> > however, this returns:
> > 
> > ans(:,:,1) =
> > 
> >     1.0693
> > 
> > 
> > ans(:,:,2) =
> > 
> >     1.4594
> > 
> > 
> > ans(:,:,3) =
> > 
> >    -0.5926
> > 
> > 
> > ans(:,:,4) =
> > 
> >     0.9791
> > 
> > 
> > and it wont put that into a 1d array, namely [1.06 1.4
-.59 .97]
> > 
> > how would i do this?
> > 
> 
> Does
> 
> » x=rand(3)
> x =
>      0.9501    0.4860    0.4565
>      0.2311    0.8913    0.0185
>      0.6068    0.7621    0.8214
> » y=x(:,1)
> y =
>      0.9501
>      0.2311
>      0.6068
> » z = y'
> z =
>      0.9501    0.2311    0.6068
> »
> 
> give you any ideas???
> 
> --