convert matrix data to cell array data

1 回表示 (過去 30 日間)
MUKESH KUMAR
MUKESH KUMAR 2020 年 5 月 8 日
回答済み: per isakson 2020 年 5 月 8 日
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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by