How to use sinc function in a piecewise operation

I am getting an error that reads, "Check for missing argument or incorrect argument data type in call to function 'sinc' ". I am trying to implement this piecewise function, when and 0 otherwise. This is what I am doing,
t = 0: 0.0001: 0.1;
m = (sinc(100*t))*(abs(t) <= to);

 Akzeptierte Antwort

David Hill
David Hill am 12 Apr. 2020
t = -.1: 0.0001: 0.1;
t0=.09;
m = (sinc(100*t)).*(abs(t) <= t0);
plot(t,m);

5 Kommentare

Unfortunately, this method still does not work.
What is not working? It is working fine for me. Are you getting the plot, or do you think the plot is wrong?
I am not getting the plot, I am still getting the same error as before. I copied and pasted your code exactly.
Do you have the Signal Processing Toolbox? If not, you will have to program sinc.
t = -.1: 0.0001: 0.1;
t=t(t~=0);
t0=.09;
m = (sin(pi*100*t))./(pi*100*t).*(abs(t) <= t0);
plot(t,m);
Thanks, that seemed to be the problem, it works fine with the Signal Processing Toolbox.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Communications Toolbox finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by