How to convert a matrix into some cells?

1 visualización (últimos 30 días)
Pooneh Shah Malekpoor
Pooneh Shah Malekpoor el 14 de Mayo de 2021
Comentada: Pooneh Shah Malekpoor el 14 de Mayo de 2021
Hello
I have a big matrix which i want to convert to equal submatrixces in cell form. As an illustration imagine this matrix:
[1 0 ;
23 13;
1 9;
4 6;
7 13;
0 32]
how can i convert it into a matrix with three matrices in the form of cell?
such as
[{cell1};{cell2};{cell3}] where cell1=[1 0 ; 23 13] and cell2=[1 9;4 6] and cell3=[7 13;0 32] ?
it was a small example, imagine that i do not know how many 2*2 cells are there in the original matrix
Bests

Respuesta aceptada

Matt J
Matt J el 14 de Mayo de 2021
Editada: Matt J el 14 de Mayo de 2021
You can use mat2tiles, which you must Download.
A=[1 0 ;
23 13;
1 9;
4 6;
7 13;
0 32];
Acell = mat2tiles(A,[2,2]);
Acell{:}
ans = 2×2
1 0 23 13
ans = 2×2
1 9 4 6
ans = 2×2
7 13 0 32

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by