Error with sinc command
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have enclosed the code I used, and matlab returns the error "Check for incorrect argument data type or missing argument in call to function 'sinc'."
I tried the code in Octave online and it works flawlessly. Is there a problem with my Matlab code or some error I'm not seeing?
t = linspace(-5,5,100);
X = sinc(t);
y = fft(X);
mag = abs(fftshift(y));
f = linspace(0,100);
figure(1)
plot(t,X)
title('Figure 1')
figure(2)
plot(f,mag)
title('Figure 2')
Check for incorrect argument data type or missing argument in call to function 'sinc'.
3 Kommentare
Antworten (1)
John D'Errico
am 11 Jul. 2022
sinc is also present in the symbolic toolbox, though it would not be of use here. You need the signal processing toolbox for the code you wrote to work.
which sinc -all
However, the error message you got is not the one I expect to see for a missing function. For example, if I do this:
t = 1:5;
hwrthwrhwyh(t)
where there is no function of that name in MATLAB, it will throw an error, but not the one you got. But if you have ONLY the symbolic toolbox and NOT the signal processing toolbox, as is my case) then you will get this error:
sinc(1:5)
Check for incorrect argument data type or missing argument in call to function 'sinc'.
And that is the error message you got. That leads me to suspect that you lack the signal processing TB, and do have the symbolic TB.
So if you want that code to work in MATLAB, you need to buy the signal processing toolbox.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

