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.subsrefNot enough inputs to inline function.Error in
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 11:12:51
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.subsrefNot enough inputs to inline function.Error in
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));
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.subsrefNot enough inputs to inline function.Error in
fun=inline('sqrt(1+(cos(x).^2)')
这里x是向量 要用点乘或者点幂
fun=inline('sqrt(1+(cos(x).^2))')
fun =
Inline function:
fun(x) = sqrt(1+(cos(x).^2))
>> [R,T]=Romberg(fun,[0 4],1e-6)
R =
4.9666
T =
5.2178 0 0 0 0 0 0
4.7752 4.6276 0 0 0 0 0
4.9314 4.9834 5.0072 0 0 0 0
4.9578 4.9667 4.9656 4.9649 0 0 0
4.9645 4.9667 4.9667 4.9667 4.9667 0 0
4.9661 4.9666 4.9666 4.9666 4.9666 4.9666 0
4.9665 4.9666 4.9666 4.9666 4.9666 4.9666 4.9666