Help with MATLAB Code - Plot is ignoring 0 value

Hello, I am using R2016b to plot magnitude and phase of a fourier series (periodic), but the plot is ignoring the 0 value of the function. Can anyone tell me if I am missing something in the code? The 0 value is not undefined.

 採用された回答

Rik
Rik 2018 年 9 月 2 日

0 投票

Actually the zero value is undefined, because of a division by zero. You can use isnan to replace this with 0.

その他の回答 (1 件)

Aaron Frazier
Aaron Frazier 2018 年 9 月 2 日
編集済み: Aaron Frazier 2018 年 9 月 4 日

0 投票

Thank you very much. Rik, you are absolutely correct that a is undefined at 0 due to a division by 0. I changed the function using l'hospital's rule to solve for the 0 value.

1 件のコメント

Rik
Rik 2018 年 9 月 5 日
You should put your code here as text (and use the {}Code button to have a correct markup). That way people can copy and paste your code.

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

製品

タグ

質問済み:

2018 年 9 月 2 日

コメント済み:

Rik
2018 年 9 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by