Regarding integer and floating point number in an array
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
i want to have matrix that can store integer values as well as floating point number in an matrix,but it makes integer value 0.
0 comentarios
Respuestas (2)
  Azzi Abdelmalek
      
      
 el 22 de Abr. de 2016
        
      Editada: Azzi Abdelmalek
      
      
 el 22 de Abr. de 2016
  
      Maybe it displays it as 0, but doesn't makeit equal to zero, for example
a=[1235.25 1]
displays it as
   1.0e+05 *
    1.2554    0.0000
Now try to change the format
format long
a
0 comentarios
  Walter Roberson
      
      
 el 22 de Abr. de 2016
        You might be talking about having a uint8 or other integer data type stored in the same matrix as single or double. That cannot be done in MATLAB; the closest you can get is to use cell arrays.
0 comentarios
Ver también
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!


