Thread Subject: extract array from multi-dimensional array

Subject: extract array from multi-dimensional array

From: Jose Miguel Jauregui

Date: 3 Sep, 2009 18:33:21

Message: 1 of 2

Hi,

I have a 4-D matlab variable called data; size(data)= 192 94 1 1464; ndims(data)=4;
When I write whos in matlab, data is described as 4-D size variable;

I want to extract all the values for data(12,15,1,:), and when I write in matlab:

datum=data(12,15,1,:); datum is also described as a 4-D size array, why is this happening? Shouldn't I get a single-dimension array? i.e. size(datum)=1 1464??

If I'm doing something wrong, could you please tell how can I extract these values from data?

Could you please help me, this issue is driving me crazy!!
Thank you so much to every body,
Best regards,
Jose

Subject: extract array from multi-dimensional array

From: Andy

Date: 3 Sep, 2009 18:54:03

Message: 2 of 2

"Jose Miguel Jauregui" <aupaosasuna60@hotmail.com> wrote in message <h7p25h$q76$1@fred.mathworks.com>...
> Hi,
>
> I have a 4-D matlab variable called data; size(data)= 192 94 1 1464; ndims(data)=4;
> When I write whos in matlab, data is described as 4-D size variable;
>
> I want to extract all the values for data(12,15,1,:), and when I write in matlab:
>
> datum=data(12,15,1,:); datum is also described as a 4-D size array, why is this happening? Shouldn't I get a single-dimension array? i.e. size(datum)=1 1464??
>
> If I'm doing something wrong, could you please tell how can I extract these values from data?
>
> Could you please help me, this issue is driving me crazy!!
> Thank you so much to every body,
> Best regards,
> Jose

It's 4-D because the largest dimension with size greater than 1 is the fourth. (I think it will be size [1 1 1 1464], but you can check to make sure.) Use the squeeze function to collapse it to a size [1464 1] vector.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
extract Jose Miguel Jauregui 3 Sep, 2009 14:34:22
array Jose Miguel Jauregui 3 Sep, 2009 14:34:22
multidimensional Jose Miguel Jauregui 3 Sep, 2009 14:34:22
4d Jose Miguel Jauregui 3 Sep, 2009 14:34:22
dimension Jose Miguel Jauregui 3 Sep, 2009 14:34:22
rssFeed for this Thread

Contact us at files@mathworks.com