Error of not enough arguments while using quad in matlab -
i used quad function way:
f = @(x)1./(x.^3-2*x-5); q = quad(f,0,2);
but f function changed to:
f = @(x,y) y./(x.^3-2*x-5);
i using quad inside other loop i've got y value each iteration.
i tried use quad way:
q = quad(f(y),0,2);
but error of not enough arguments. can do?
you can use anonymous function defined in x
evaluate f(x,y)
when y
known
q = quad(@(x) f(x,y), 0, 2)
Comments
Post a Comment