[英]integral of unit step function or delta function in matlab
I want to use int
or integral
function of matlab to calculate the integral of the delta function, I can't use int
function because of the input, I give it is not expression. 我想使用int
或matlab的integral
函数来计算delta函数的积分,由于输入,我不能使用int
函数,我给出的不是表达式。 also, integral
function returns a value which it isn't something below picture is the function which I want to produce it must be with delta function 同样, integral
函数返回一个值,它不是下图所示的东西,我要生成的函数必须与delta函数一起使用
this is my code that return ma an error: 这是我的代码,返回错误:
t=-5:0.01:5;
ydelta=u(t+1)-u(t);
h=int(u(t+1)-u(t));
plot(t,h)
this is u
function: 这是u
功能:
function y=u(t)
y=(t>=0);
end
and this is an error : Undefined function 'int' for input arguments of type 'double'. 这是一个错误:类型为'double'的输入参数的未定义函数'int'。 but this does not matter because the problem is the input of int
function which must be expression. 但这无关紧要,因为问题在于必须是表达式的int
函数的输入。
how can I fix this problem? 我该如何解决这个问题?
For integration, you have to use the integral
function. 为了集成,必须使用integral
功能。 For more info: https://it.mathworks.com/help/matlab/ref/integral.html 有关更多信息: https : //it.mathworks.com/help/matlab/ref/integral.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.