0
votes

I have a simple function written

function[] = myfun(p,q)
fminbnd(@(x)myfun1(q,p,b),0,1)

where myfun1's output is from the function quad.

How do I plot myfun? I've tried fplot(@(x)myfun(1,x),0,1) but this gives me a matrix dimensions must agree error...

1

1 Answers

0
votes

Your question does not contain enough information to identify exactly where the problem lies, but one issue is certainly that myfun does not return any output. What should fplot plot, if there is nothing returned by the function?

Try

function out = myfun(p,q)
%# you may want to define b here
out = fminbnd(@(x)myfun1(q,p,b),0,1);

If that doesn't fix the issue, turn on the debugging mode by typing dbstop if error at the command line. This will show where exactly the error occurs, and allow you to inspect the variables for correct shape.