convert matrix data to cell array data

2 visualizaciones (últimos 30 días)
MUKESH KUMAR
MUKESH KUMAR el 8 de Mayo de 2020
Respondida: per isakson el 8 de Mayo de 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

Respuesta aceptada

per isakson
per isakson el 8 de Mayo de 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

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