From: pier on
hi i have a matrix 12x52
every four column rapresent for me the coordinate x,y,rssi and lqi
So i need to obtaine 13 matrix with size 12x4!!!!
how can i do this?????
please help me...........
From: us on
"pier " <bombociccio1(a)libero.it> wrote in message <hskq7q$74m$1(a)fred.mathworks.com>...
> hi i have a matrix 12x52
> every four column rapresent for me the coordinate x,y,rssi and lqi
> So i need to obtaine 13 matrix with size 12x4!!!!
> how can i do this?????
> please help me...........

a hint:

help reshape;

us
From: Matt Fig on
Let's take a simpler example. A matrix 2-by-12 which needs to be broken into 4 2-by-3 matrices. Store each new matrix as a cell in a cell array.

% Data
A = round(rand(2,12)*100)

% Engine
Ac = mat2cell(A,2,ones(1,4)*3);
% Now check a couple of the arrays.
Ac{1}
Ac{4}
From: pier on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hskuq0$d9i$1(a)fred.mathworks.com>...
> Let's take a simpler example. A matrix 2-by-12 which needs to be broken into 4 2-by-3 matrices. Store each new matrix as a cell in a cell array.
>
> % Data
> A = round(rand(2,12)*100)
>
> % Engine
> Ac = mat2cell(A,2,ones(1,4)*3);
> % Now check a couple of the arrays.
> Ac{1}
> Ac{4}

hi thx for the answer.... but with your instruction i have obtained only 2 matrix 2x3
using matrix A:2x12 i'm tryng to obtained four matric 2x3!!!!
right?????
where is the error?

PS:
i tried also function RESHAPE but as output obtained only 1 matrix even if customized
From: us on
"pier " <bombociccio1(a)libero.it> wrote in message <hslqf5$oqb$1(a)fred.mathworks.com>...
> "Matt Fig" <spamanon(a)yahoo.com> wrote in message <hskuq0$d9i$1(a)fred.mathworks.com>...
> > Let's take a simpler example. A matrix 2-by-12 which needs to be broken into 4 2-by-3 matrices. Store each new matrix as a cell in a cell array.
> >
> > % Data
> > A = round(rand(2,12)*100)
> >
> > % Engine
> > Ac = mat2cell(A,2,ones(1,4)*3);
> > % Now check a couple of the arrays.
> > Ac{1}
> > Ac{4}
>
> hi thx for the answer.... but with your instruction i have obtained only 2 matrix 2x3
> using matrix A:2x12 i'm tryng to obtained four matric 2x3!!!!
> right?????
> where is the error?

simple: copy/paste the nice solution, LOOK AT it carefully, THINK ABOUT it, then do

whos Ac;
{%
Name Size Bytes Class Attributes
Ac 1x4 432 cell
%}
% with
Ac.'
{%
% ans =
[2x3 double]
[2x3 double]
[2x3 double]
[2x3 double]
%}

us