Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
怎样才能1/ln(x)集成到Matlab中?
1/ln(x)
y=0:.1:1; a=log(y); plot(a,y); z=quad(a,-2,2);
我以为这会奏效。
这对我有用:
z = quad(@(x) 1./log(x), 2, 10)
并给出结果
z = 5.1204
您不能在区间 -2:2 内积分,因为在 x = 0 时自然对数未定义,而在 x = 1 时,自然对数为 0,因此未定义倒数。