Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
matrix to vector of structure of vectors

Subject: matrix to vector of structure of vectors

From: Juan Marcos

Date: 7 Feb, 2013 13:41:08

Message: 1 of 3

Hi,

I have seen similar posts, but I have not been able to solve this specific problem.

Given some matrixes with the same size: a(m,n), b(m,n) and c(m,n), is it possible to assign their different rows to a vector of structures like:

data(m).a(n)
data(m).b(n)
data(m).c(n)

without using a loop?

Thank you very much for your help.

Subject: matrix to vector of structure of vectors

From: Jos (10584)

Date: 7 Feb, 2013 14:25:08

Message: 2 of 3

"Juan Marcos " <marcos04@imperial.ac.uk> wrote in message <kf0atk$rq9$1@newscl01ah.mathworks.com>...
> Hi,
>
> I have seen similar posts, but I have not been able to solve this specific problem.
>
> Given some matrixes with the same size: a(m,n), b(m,n) and c(m,n), is it possible to assign their different rows to a vector of structures like:
>
> data(m).a(n)
> data(m).b(n)
> data(m).c(n)
>
> without using a loop?
>
> Thank you very much for your help.

Why on earth do you want to do this? And why without loops?

~ Jos

Subject: matrix to vector of structure of vectors

From: Juan Marcos

Date: 7 Feb, 2013 14:50:08

Message: 3 of 3

"Jos (10584)" wrote in message <kf0dg4$95v$1@newscl01ah.mathworks.com>...
> "Juan Marcos " <marcos04@imperial.ac.uk> wrote in message <kf0atk$rq9$1@newscl01ah.mathworks.com>...
> > Hi,
> >
> > I have seen similar posts, but I have not been able to solve this specific problem.
> >
> > Given some matrixes with the same size: a(m,n), b(m,n) and c(m,n), is it possible to assign their different rows to a vector of structures like:
> >
> > data(m).a(n)
> > data(m).b(n)
> > data(m).c(n)
> >
> > without using a loop?
> >
> > Thank you very much for your help.
>
> Why on earth do you want to do this? And why without loops?
>
> ~ Jos

Hi Jos

Each one of the rows corresponds to a particular configuration that I will later arrange into a matrix of structures. Each one of the columns is kind of a summary of temporal information (actually they are the most important modes of my system and their frequencies). I would like to access the struct as data(a,b).a. It may look a bit weird but I think it makes logic sense with the rest of my script.

At the moment I am using loops to do it, but I know matlab is more efficient when working without them, using their implicit functions for data management. That is why I was wondering if there was any way to do it faster.

Thank you

Tags for this Thread

No tags are associated with this thread.

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.

Contact us