Hello,
I want to do something like this but without global variables. I want to run myfuncall.m and then I want to have the variables A and B available in myfun.m. and the result in command window .
In other programs I already deliviered variables successfully in the function in this style: [result1, result2]=myFunctionname(variable1, variable2) but here I tried but it didn't work.
%myfuncall.m
x0=[0 0];A=3;B=4;x=fsolve(@myfun,x0)
%myfun.m
function F = myfun(x)F = [2*x(1) - x(2) - exp(-x(1))-A; -x(1) + 2*x(2) - exp(-x(2))-B];end
Many thanks in advance
Best Answer