问题描述:
matlab中 sqrt(1+(cos(x))^2)的积分
>> fun=inline('sqrt(1+(cos(x))^2)')
fun =
Inline function:
fun(cos,x) = sqrt(1+(cos(x))^2)
>> [R,k,T]=Romberg(fun,realmin,4,1e-6)
Error using ==> inline.subsref
Not enough inputs to inline function.
Error in ==> Romberg at 13
T=h/2*(fun(a)+fun(b));
>> syms x
>> fun=sqrt(1+(cos(x))^2)
fun =
(1+cos(x)^2)^(1/2)
>> [R,k,T]=Romberg(fun,0,4,1e-6)
Subscript indices must either be real positive integers or logicals.
Error in ==> Romberg at 13
T=h/2*(fun(a)+fun(b));
>> fun=inline('sqrt(1+(cos(x))^2)')
fun =
Inline function:
fun(cos,x) = sqrt(1+(cos(x))^2)
>> [R,k,T]=Romberg(fun,realmin,4,1e-6)
Error using ==> inline.subsref
Not enough inputs to inline function.
Error in ==> Romberg at 13
T=h/2*(fun(a)+fun(b));
>> syms x
>> fun=sqrt(1+(cos(x))^2)
fun =
(1+cos(x)^2)^(1/2)
>> [R,k,T]=Romberg(fun,0,4,1e-6)
Subscript indices must either be real positive integers or logicals.
Error in ==> Romberg at 13
T=h/2*(fun(a)+fun(b));
问题解答:
我来补答展开全文阅读