How can I compare frequency or amplitude of the given signal by matlab?

3 ビュー (過去 30 日間)
minsoo kim
minsoo kim 2017 年 11 月 30 日
コメント済み: minsoo kim 2017 年 11 月 30 日
Let's say I have a signal A.
If the frequency of A is higher than B frequency then the matlab returns certain output.
I used "switch" to do this task, but it didn't work.
ex)
switch signalA
case ((signalA>400)-(signalA>800))
disp('1');
case ((signalB>800)-(signalB>1200))
disp('2');
otherwise
disp('none');
end
I know the code above is wrong because "signal A" doesn't show any values(frequency or amplitude).
so, How can I compare frequency or amplitude of the given 2 signals by matlab?

採用された回答

KSSV
KSSV 2017 年 11 月 30 日
Check this pseudo code:
for i = 1:10
x = rand ; y = rand ;
if x > y
fprintf('x > y \n')
else
fprintf('x < y \n')
end
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB 시작하기 についてさらに検索

Community Treasure Hunt

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

Start Hunting!