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

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

splitting uneven matrx in to two parts

Asked by PK on 29 Jun 2013

using mat2cell we can convert a big array in different cells but all are stored in a single variable as double matrices so how can we assign them to seperate variables......ie., we split A=140x13 matrix in to 100x13 and 40x13 with A0=mat2cell(A,[100,40]) command it will be stored as [100x13 double] [ 40x13 double] cells in the same variable ,,,so after splitting how can we pin 100x13 and 40x13 to two different variables

0 Comments

PK

Products

No products are associated with this question.

1 Answer

Answer by Image Analyst on 29 Jun 2013

First read this: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F

Then try this:

A = randi(9, [140, 13]);
A0=mat2cell(A,[100,40]) 
topRows = A0{1};
bottomRows = A0{2};
% Or even better
topRows2 = A(1:100, :);
bottomRows2 = A(101:end,:);

0 Comments

Image Analyst

Contact us