I'm trying to solve fzero for each value of x in an array, and I get theis error:
Don't Do That.
fzero() is defined as only accepting scalar equations of one variable. It cannot in itself be used to solve at multiple x values simultaneously
You need to loop through the different x values, constructing the other values such as a or r as you go.
If you make a and r into functions of the current x value, then you can probably arrayfun() the fzero() call.