writing binary number with specific length (MATLAB)
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    high speed
 el 30 de Nov. de 2022
  
    
    
    
    
    Respondida: David Hill
      
      
 el 30 de Nov. de 2022
            Dear,
I have this simple program:
n=3;
A=0.2;
B=[0.7 0.5 0.3 0.1 0.1 0.3 0.5 0.7];
K=dec2bin(B/A);
The output K is of type 8x2 with results:
val =
    '11'
    '10'
    '01'
    '00'
    '00'
    '01'
    '10'
    '11'
I want to obtain K with type 8x3 it means according to 'n' to obtain these results:
val =
    '011'
    '010'
    '001'
    '000'
    '000'
    '001'
    '010'
    '011'
0 comentarios
Respuesta aceptada
  David Hill
      
      
 el 30 de Nov. de 2022
        n=3;
A=0.2;
B=[0.7 0.5 0.3 0.1 0.1 0.3 0.5 0.7];
K=dec2bin(B/A,3)
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Get Started with MATLAB 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!

