Borrar filtros
Borrar filtros

Should sinc() be Implemented with sinpi()?

2 visualizaciones (últimos 30 días)
Paul
Paul el 25 de En. de 2023
Comentada: Paul el 3 de Feb. de 2023
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?

Respuesta aceptada

Ganesh Thambhahalli Satyen
Ganesh Thambhahalli Satyen el 25 de En. de 2023
Editada: Ganesh Thambhahalli Satyen el 25 de En. de 2023
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 comentario
Paul
Paul el 3 de Feb. de 2023
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)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by