Borrar filtros
Borrar filtros

How do get the cell matrix to be double?

3 visualizaciones (últimos 30 días)
Derick Wong
Derick Wong el 4 de En. de 2014
Editada: Azzi Abdelmalek el 4 de En. de 2014
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]

Respuestas (2)

Ruwan
Ruwan el 4 de En. de 2014
Is this maybe what you are looking for?
DecompDict = cell2mat(dict);
  1 comentario
Derick Wong
Derick Wong el 4 de En. de 2014
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 ?

Iniciar sesión para comentar.


Azzi Abdelmalek
Azzi Abdelmalek el 4 de En. de 2014
Editada: Azzi Abdelmalek el 4 de En. de 2014
out=cellfun(@str2num,DecompDict,'un',0)
To display your data
celldisp(out)
1x10 double means an array of ten numbers (double class)

Categorías

Más información sobre Logical 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