Should sinc() be Implemented with sinpi()?

2 次查看(过去 30 天)
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
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 CenterFile Exchange 中查找有关 Get 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