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

Antworten (1)

Walter Roberson
Walter Roberson am 9 Mär. 2023

0 Stimmen

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.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 9 Mär. 2023

Beantwortet:

am 9 Mär. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by