convert matrix data to cell array data
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MUKESH KUMAR
le 8 Mai 2020
Réponse apportée : per isakson
le 8 Mai 2020
I had matrix data of size A(5*1536) and now i want to convert it into cell array in the form of B(1*1536) cell and each cell having 5*1 double data.
for example:
A = [0 0.250000000000000 0.465681355424464 0.180826060563253 0.542500048530739
0 0.250000000000000 0.465681355424464 0.180826060563253 0.542500048530739
0.0434782608695652 0.250000000000000 0.449556033065706 0.214226276949460 0.542500048530739
.....................................................................................................
.......................................................................................1536 rows ]
and
B should be like this
B = {5*1 double} (5*1 double)..............1536 columns
thanks
0 commentaires
Réponse acceptée
per isakson
le 8 Mai 2020
Try this
>> num2cell( magic(5), 1 )
ans =
1×5 cell array
Columns 1 through 4
{5×1 double} {5×1 double} {5×1 double} {5×1 double}
Column 5
{5×1 double}
>>
I assume
B = num2cell( A, 1 );
solves your problem
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!