I want to execute this code but there is an error in function command,please modify this program to get the output

function[X]= generateSin(a,f,ph,t,Fs)
f=5;
a=3;
ph=pi/2;
Fs=300;
T=1/Fs;
L=1000;tmax=L*T;
t=0:T:tmax-T;
X=a*sin(2*pi*t*f+ph);
figure()
plot(t,X)
end

댓글 수: 2

This code works for me! What do you mean with "there is an error"?
sandhya - why does your function signature have input parameters which you then overwrite with
f=5;
a=3;
ph=pi/2;
Fs=300;

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

질문:

2019년 6월 7일

댓글:

2019년 6월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by