Thread Subject: operation with vector and matrix

Subject: operation with vector and matrix

From: rubionelove

Date: 12 Jun, 2009 14:07:02

Message: 1 of 3

Dear all,
I've a 3 dimension matrix called sequence
I want to put in a vector all the values of a given coordinate xy along the 3rd dimension.

I tried this

vector = sequence (x,y,:)

but the resulting vector is tree dimensional 1 x 1 x size(sequence,3)
I want vector to be 2 dimensional 1 x size(sequence,3)

many thanks in advace

Subject: operation with vector and matrix

From: Bruno Luong

Date: 12 Jun, 2009 14:13:02

Message: 2 of 3

"rubionelove " <rubionelove@gmail.com> wrote in message <h0tne6$oj3$1@fred.mathworks.com>...
> Dear all,
> I've a 3 dimension matrix called sequence
> I want to put in a vector all the values of a given coordinate xy along the 3rd dimension.
>
> I tried this
>
> vector = sequence (x,y,:)
>
> but the resulting vector is tree dimensional 1 x 1 x size(sequence,3)
> I want vector to be 2 dimensional 1 x size(sequence,3)
>
> many thanks in advace

There is a function SQUEEZE that removes singleton dimensions.

Bruno

Subject: operation with vector and matrix

From: rubionelove

Date: 12 Jun, 2009 14:41:02

Message: 3 of 3

thank you very much Bruno,
exactly what I was looking for.

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
vector Sprinceana 22 Jun, 2009 07:02:38
matrix Sprinceana 22 Jun, 2009 07:02:38
rssFeed for this Thread

Contact us at files@mathworks.com