フィルターのクリア

Task for generating a wave

1 回表示 (過去 30 日間)
Atta Bukhari
Atta Bukhari 2020 年 10 月 8 日
回答済み: Attaullah Shafiq 2020 年 10 月 8 日
Can you suggest me some unique code for Sine wave
  1 件のコメント
Atta Bukhari
Atta Bukhari 2020 年 10 月 8 日
Thanks

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

採用された回答

Attaullah Shafiq
Attaullah Shafiq 2020 年 10 月 8 日
%Sine wave example
f=3; %frequency [Hz]
t=(0:1/(f*100):1);
a=2; %amplitude [V]
phi=0; %phase
y=a*sin(2*pi*f*t+phi); %formula
plot(t,y)
xlabel('Time') %label
ylabel('Amplitude') %label
title('Sine Wave)'); %Title

その他の回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 10 月 8 日
unique code for Sine wave
What about using a taylor series?
N = 20;
x = 0.1;
y = @(xv) arrayfun(@(x) sum((-1).^(0:N-1).*x.^(2*(1:N)-1)./factorial(2*(1:N)-1)), xv);
xv = linspace(0, 2*pi);
yv = y(xv);
plot(xv, yv)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by