You didn't allocate for each element of the output arrays but computed each point one-at-a-time by using an unneeded for...end loop. Use MATLAB array syntax instead--
mbat = (35000-10000*v)/3000;
mcap = (35000-3000*v)/10000;
NB: I also took out the reuse of same variable and redefinition of mcap as both input and output in lieu of a single variable, v, for the independent variable.