0

我已经编写了一个代码来使用 matlab 实现微分器和积分器。我能够获得微分和积分的输出,但是在绘制图形时遇到了麻烦。我得到如下错误。

从 double 到 sym 的转换是不可能的。

我附上了下面的代码。

clc;
close all;
syms t;
y=input('Enter the function : ');
T=input('enter the period of the function : ');
t=0:0.001*(1/T):1/T;
intop=int(y)
difop=diff(y)
figure(1)
plot(t,intop);
xlabel('time in t');
ylabel('Amplitude ');
title('integrator o/p');
zoom;
grid;
figure(2)
plot(t,difop);
xlabel('time in t');
ylabel('Amplitude ');
title('diffrentiator  o/p');
zoom;
grid;

请让我知道我哪里出错了。

4

0 回答 0