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:
Combining arrays of different sizes in one matrix

Subject: Combining arrays of different sizes in one matrix

From: Phil

Date: 6 Feb, 2009 08:42:01

Message: 1 of 3

Hello.

I have several arrays of various sizes which i would like to combine into one matrix.

The arrays are as follows:

[220x1 double] [300x1 double] [224x1 double]

I would like to create a matrix with the number of rows equal to the largest array then any arrays which have less rows to be filled with NaN.

Can anyone help?

Thanks,

Phil

Subject: Combining arrays of different sizes in one matrix

From: Dave Brackett

Date: 6 Feb, 2009 08:59:02

Message: 2 of 3

"Phil " <harsh_classic@yahoo.co.uk> wrote in message <gmgt4p$lh6$1@fred.mathworks.com>...
> Hello.
>
> I have several arrays of various sizes which i would like to combine into one matrix.
>
> The arrays are as follows:
>
> [220x1 double] [300x1 double] [224x1 double]
>
> I would like to create a matrix with the number of rows equal to the largest array then any arrays which have less rows to be filled with NaN.
>
> Can anyone help?
>
> Thanks,
>
> Phil


This function on the file exchange looks to do what you want:
http://www.mathworks.com/matlabcentral/fileexchange/209

Subject: Combining arrays of different sizes in one matrix

From: Phil

Date: 6 Feb, 2009 09:24:01

Message: 3 of 3

Many thanks!

All sorted!

Regards,

Phil


"Dave Brackett" <davebrackett@hotmail.com> wrote in message <gmgu4m$rqe$1@fred.mathworks.com>...
> "Phil " <harsh_classic@yahoo.co.uk> wrote in message <gmgt4p$lh6$1@fred.mathworks.com>...
> > Hello.
> >
> > I have several arrays of various sizes which i would like to combine into one matrix.
> >
> > The arrays are as follows:
> >
> > [220x1 double] [300x1 double] [224x1 double]
> >
> > I would like to create a matrix with the number of rows equal to the largest array then any arrays which have less rows to be filled with NaN.
> >
> > Can anyone help?
> >
> > Thanks,
> >
> > Phil
>
>
> This function on the file exchange looks to do what you want:
> http://www.mathworks.com/matlabcentral/fileexchange/209

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