不定积分的问题。

8 views (last 30 days)
jiyerw
jiyerw on 24 Nov 2022
Answered: watog on 24 Nov 2022
这样一段代码
clear;clc
syms x
y0=0.3*10^-3*x^3;
y1=0.3*10^-3*x^5;
w1=y0+y1;
o1=int(w1);
p1=100*(y1/10+y0/8)*x^-2*exp(-2*o1);
rcs=p1*x^2;
pdx=-log(p1*x^2);
e=exp(-pdx);
Sum=int(e);
ezplot(Sum);
运行时候出错:
??? Error using ==> inlineeval at 15
Error in inline expression ==> int(((3.*x.^5)./1000 +
(3.*x.^3)./800)./exp((x.^4.*(2.*x.^2 + 3))./20000), x)
Undefined function or method 'int' for input arguments of type 'double'.
Error in ==> inline.feval at 36
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr,
INLINE_OBJ_.expr);
Error in ==> ezplotfeval at 52
z = feval(f,x(1));
Error in ==> ezplot>ezplot1 at 464
[y,f,loopflag] = ezplotfeval(f,x);
Error in ==> ezplot at 144
[hp,cax] = ezplot1(cax,f{1},vars,labels,args{:});
Error in ==> sym.ezplot at 45
h = ezplot(char(f));
Error in ==> question at 12
ezplot(Sum);
其中,e的表达式为
((3*x^5)/1000 + (3*x^3)/800)/exp((x^4*(2*x^2 + 3))/20000)
Sum的表达式为
int(((3*x^5)/1000 + (3*x^3)/800)/exp((x^4*(2*x^2 + 3))/20000), x)
为什么Sum没有积出来,而是保留了int的形式?是不是这个表达式本身就积不出来?如果是的话,那要怎么办才能把图画出来呢

Accepted Answer

watog
watog on 24 Nov 2022
integral是2012a出现的函数,你的版本比较老没有这个函数,可以用quadv替代:
Sum=@(x)quadv(@(t)ef(t*x).*x,0,1);

More Answers (0)

Categories

Find more on 函数基础知识 in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!