si=2*(round(rand(1,sbit))-1/2);
    1 visualización (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    aya
 el 5 de Nov. de 2013
  
    
    
    
    
    Respondida: Azzi Abdelmalek
      
      
 el 5 de Nov. de 2013
             i am trying to generate a random signal with only +1 & -1 the code works the only problem that i donot under stand way we put the 2 and -1/2
0 comentarios
Respuesta aceptada
  Azzi Abdelmalek
      
      
 el 5 de Nov. de 2013
        a=rand% 
b=rand(a) % the result is 0 or 1
%If b=1
2*(1-1/2)=1
%If b=0
2*(0-1/2)=-1
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Signal Processing 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!

