# convert matrix data to cell array data

조회 수: 4(최근 30일)
MUKESH KUMAR 8 May 2020
답변: per isakson 8 May 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

댓글을 달려면 로그인하십시오.

### 채택된 답변

per isakson 8 May 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 );

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

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

Start Hunting!

Translated by