フィルターのクリア

Should sinc() be Implemented with sinpi()?

2 ビュー (過去 30 日間)
Paul
Paul 2023 年 1 月 25 日
コメント済み: Paul 2023 年 2 月 3 日
Here are the relevant lines that implement sinc
dbtype sinc.m 24:27
24 i=find(x==0); 25 x(i)= 1; % From LS: don't need this is /0 warning is off 26 y = sin(pi*x)./(pi*x); 27 y(i) = 1;
Should line 26 now be implemented with sinpi?
If concerned with changing results of existing code, perhaps an optional input to specify implementation in terms of sinpi instead of sin?

採用された回答

Ganesh Thambhahalli Satyen
Ganesh Thambhahalli Satyen 2023 年 1 月 25 日
編集済み: Ganesh Thambhahalli Satyen 2023 年 1 月 25 日
Hey Paul,
From your question, I understand that you are requesting for an enhancement in the sinc function to have the following:
  1. The existing sinc function code should replace sin(pi*x) with sinpi(x).
  2. An optional input should be introduced for specifying whether the sinc computation is using sin or sinpi.
If so, I would like to let you know that an enhancement request about considering converting "sinc" to use sinpi for better accuracy has been submitted to our developers.
Thank you for your feedback.
  1 件のコメント
Paul
Paul 2023 年 2 月 3 日
Thanks for the response. matlabFunction is another candidate for consideration
syms x
matlabFunction(sin(2*sym(pi)*x))
ans = function_handle with value:
@(x)sin(x.*pi.*2.0)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by