Hi boutaina,
Since it's easy in Matlab to make your own functions, you don't need toolboxes that are (probably not intentionally, but still) sequestering simple mathematical functions that should be available to one and all in the core product. Just store the function somewhere on your Matlabpath.
function y = sincc(x)
y = sin(pi*x)./(pi*x);
y(x==0) = 1;
end
This function could be called sinc, but when making an alternative version of functions that Matlab has, I tend to use a name such as sincc so as to not conflict with the Matlab name. Then if you were to get one of the toolboxes there will not be a question about which function is being used.
Note that a second common definition for sinc is the so-called unnormalized version sin(x)/x. In your context, the normalized definition is probably the right one.
0 Comments
Sign in to comment.