how to convert cell to double inside cell array
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am having A = 15×1 cell array
{2×1 double}
{2×1 double}
{2×1 double}
{2×1 double}
{2×1 double}
{2×2 cell }
{2×2 cell }
{2×2 cell }
{2×2 cell }
{2×2 cell }
{2×3 cell }
{2×3 cell }
{2×3 cell }
{2×3 cell }
{2×3 cell }
I want to convert the cell to double for A to display in the following manner
A = 15×1 cell array
{2×1 double}
{2×1 double}
{2×1 double}
{2×1 double}
{2×1 double}
{2×2 double }
{2×2 double }
{2×2 double }
{2×2 double }
{2×2 double }
{2×3 double }
{2×3 double }
{2×3 double }
{2×3 double }
{2×3 double }
1 Commento
Scott MacKenzie
il 23 Giu 2021
A is a cell array of cell arrays. It might help if you show the code that generates or loads A, se we can see what is inside the cells within the cells of A.
Risposte (1)
Walter Roberson
il 23 Giu 2021
mask = cellfun(@iscell, A);
A(mask) = cellfun(@cell2mat, A(mask), 'uniform', 0);
Vedere anche
Categorie
Scopri di più su Data Types 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!