not enough input arguments
the error is
coefficient (1) = (vpa(sub(f, x, a))); %storing f(a)
how can I fix this

답변 (1개)

Walter Roberson
Walter Roberson 2023년 3월 9일

0 개 추천

coefficient(1) = vpa( subs( f, x, a) )
Notice subs not sub
But this assumes that f is a symbolic expression, or a symbolic function, or an anonymous function that has x as one of its variables. This subs() will not work if f is a direct function. For example,
subs(EXAMPLE, x, a)
function y = EXAMPLE(x)
y = x^3-3;
end
will not work -- and neither will subs(@EXAMPLE, x, a) in that case.
You might also have recieved the message if that statement were inside a function and at leat one of f or x or a are named parameters to the function, but you called the function without passing in enough parameters.

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

질문:

2023년 3월 9일

답변:

2023년 3월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by