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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -