# How can I convert matrix to cell?

2 visualizzazioni (ultimi 30 giorni)
majid il 15 Apr 2024
Commentato: majid il 15 Apr 2024
Hello.
I have 400*100 matrix. I want to divide this matrix to every 4*100 matrix and then put it in the cell.
How can I do this?
A = reshape(1:40000,100,400)';
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Stephen23 il 15 Apr 2024
A = reshape(1:40000,100,400)';
C = mat2cell(A,4*ones(1,100),100)
C = 100x1 cell array
{4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double} {4x100 double}
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
majid il 15 Apr 2024

Accedi per commentare.

### Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by