How to stem positive part of wave?
    5 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    vu ngothanh
 am 11 Dez. 2015
  
    
    
    
    
    Kommentiert: vu ngothanh
 am 12 Dez. 2015
            Hi everyone,
I have a wave data, I need to show dispersion wave, so I need to "Stem" a "positive part" of the wave (look like the image below). Could you please to help me to solve it.
Thank you in advance.

0 Kommentare
Akzeptierte Antwort
  Prasad Kalane
      
 am 11 Dez. 2015
        
      Bearbeitet: Prasad Kalane
      
 am 11 Dez. 2015
  
      Try using following code
if true
  % code
endx1=rand(1,10);
x2=rand(1,10);
x=[x1 -x2];
subplot(121);stem(x);
title('+ve & -ve Data')
for i=1:length(x)
    if sign(x(i))==-1
        x(i)=0;
    end
end
subplot(122);stem(x);
title('+ve Data')
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Specialized Power Systems finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!