I keep getting not enough input arguments error when trying to make a sine function
이전 댓글 표시
function [x,t] = sin_NU(fs,f0,T)
t = 0:1/fs:T; %time vector
x = sin(2*pi*f0*t); %signal vector
end
I am trying to make a sine function and sample the sine signal with a certain sampling frequency. Please help, I would really appreciate it!
댓글 수: 5
Dyuman Joshi
2022년 4월 14일
편집: Dyuman Joshi
2022년 4월 14일
How are you calling your function? Show the error as well.
Use .* if f0 is not a scalar
kiroro00
2022년 4월 14일
Jamal Badiee
2022년 4월 14일
I ran your code by just copy pasting and got no error.
kiroro00
2022년 4월 14일
Works fine, @kiroro00
[x,t] = sin_NU(1000,10,0.5);
figure(1);
plot(t,x);
xlabel ('Time');
ylabel ('Signal');
title ('sin NU function test');
function [x,t] = sin_NU(fs,f0,T)
t = 0:1/fs:T; %time vector
x = sin(2*pi*f0*t); %signal vector
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spectral Measurements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

