フィルターのクリア

How to stem positive part of wave?

2 ビュー (過去 30 日間)
vu ngothanh
vu ngothanh 2015 年 12 月 11 日
コメント済み: vu ngothanh 2015 年 12 月 12 日
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.

採用された回答

Prasad Kalane
Prasad Kalane 2015 年 12 月 11 日
編集済み: Prasad Kalane 2015 年 12 月 11 日
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')
  1 件のコメント
vu ngothanh
vu ngothanh 2015 年 12 月 12 日
Thank you very much. It work perfectly.

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by