convert matrix data to cell array data

2 次查看(过去 30 天)
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

采纳的回答

per isakson
per isakson 2020-5-8
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 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by