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:
expanding cell array

Subject: expanding cell array

From: Dave Brackett

Date: 18 Jun, 2011 08:46:04

Message: 1 of 1

Hi,

I have a 6x2 cell array like this:

    [ 27.5291] [1]
    [ 0] [2]
    [1x2 double] [3]
    [1x2 double] [4]
    [ -4.5140] [5]
    [ -30.8593] [6]

I have different sized vectors in some of the cell rows [1x2 double] in this case. I want to reshape the data so that it is in the form:

    [ 27.5291] [1]
    [ 0] [2]
    [1x1 double] [3]
    [1x1 double] [3]
    [1x1 double] [4]
    [1x1 double] [4]
    [ -4.5140] [5]
    [ -30.8593] [6]

Basically just expanding the differently sized vectors. The size of these longer vectors can be arbitrary and their positions within the array are not known in advance. Can anyone suggest something please? Thanks very much.

Tags for 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