Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.germany.com!aioe.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: get a 1d vector from a multidimensional array
Date: Sun, 09 Sep 2007 15:43:32 -0500
Organization: Aioe.org NNTP Server
Lines: 57
Message-ID: <fc1m29$upv$1@aioe.org>
References: <fc1le7$449$1@fred.mathworks.com>
NNTP-Posting-Host: 2Eln8FX/iBnOvQmWJm4Lfg.user.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
Xref: news.mathworks.com comp.soft-sys.matlab:427569



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???

--