フィルターのクリア

How do get the cell matrix to be double?

3 ビュー (過去 30 日間)
Derick Wong
Derick Wong 2014 年 1 月 4 日
編集済み: Azzi Abdelmalek 2014 年 1 月 4 日
Hi all,
How do I change the DecompDict output to become double, similar to dict shown below. And what does it mean by [1x10 double] ?
DecompDict =
'-47' '[0,0,1,0,1,0,1,0,0,1]'
'-17' '[0,0,1,0,1,0,1,0,0,0]'
'-7' '[0,0,1,0,1,0,1,1,1]'
'-3' '[0,0,1,0,1,0,0]'
'-2' '[0,0,1,1]'
'-1' '[0,1]'
'0' '1'
'1' '[0,0,0]'
'2' '[0,0,1,0,0]'
'3' '[0,0,1,0,1,1]'
'7' '[0,0,1,0,1,0,1,1,0]'
'17' '[0,0,1,0,1,0,1,0,1,1]'
'30' '[0,0,1,0,1,0,1,0,1,0]'
dict =
[-47] [1x10 double]
[-17] [1x10 double]
[ -7] [1x9 double]
[ -3] [1x7 double]
[ -2] [1x4 double]
[ -1] [1x2 double]
[ 0] [ 1]
[ 1] [1x3 double]
[ 2] [1x5 double]
[ 3] [1x6 double]
[ 7] [1x9 double]
[ 17] [1x10 double]
[ 30] [1x10 double]

回答 (2 件)

Ruwan
Ruwan 2014 年 1 月 4 日
Is this maybe what you are looking for?
DecompDict = cell2mat(dict);
  1 件のコメント
Derick Wong
Derick Wong 2014 年 1 月 4 日
Hi, I have the dict that is output into file. And from file .txt, I got the values out to become DecompDic. But it does not give me back in double form. How can I get DecompDict to be double form ?

サインインしてコメントする。


Azzi Abdelmalek
Azzi Abdelmalek 2014 年 1 月 4 日
編集済み: Azzi Abdelmalek 2014 年 1 月 4 日
out=cellfun(@str2num,DecompDict,'un',0)
To display your data
celldisp(out)
1x10 double means an array of ten numbers (double class)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by