Undefined function 'int' for input arguments of type 'char'.
显示 更早的评论
Hi Guys
this code gives me this error when I tried to change it a little
Any solutions?
syms n t ;
n=50;
t=linspace(-5,5,1000);
T=max(t);
wo=(2*pi)/T;
for k=1:n
ao= (1/T).*(int('1',t,0,t));
an= (2/T).*(int('1*cos(n*wo*t)',t,0,t))
bn= (2/T).*(int('1*sin(n*wo*t)',t,0,t))
f=ao+(an.*cos(k.*wo.*t))+(bn.*sin(k.*wo.*t));
end
figure(1);clf(1)
plot(t,f)
xlabel('Time')
ylabel('Amplitude')
title('Fourier sawtooth Trasnform')
2 个评论
Newer MATLAB versions only accept symbolic inputs to int, as the documentation clearly shows:
What do you expect a character input to do? What MATLAB version are you using?
Walter Roberson
2017-12-5
Character input is still supported, though no longer documented.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!