hi
I am trying to solve no linear equation using fsolve "mtalab" but i dont know why it doest work
the function is
function y=resol(x)
CF3=x(1);
CCa3=x(2);
CSO43=x(3);
X=x(4);
Y=x(5);
y(1)=KsCaSO4-CSO43*CCa3;
y(2)=KsCaF2-CCa3*CF3^2;
y(3)=Q1*CF1-Q3*CF3-X;
y(4)=Q1*CSO41-Q3*CSO43-Y;
y(5)=Q2*CCa2-Q3*CCa3-X-Y;
end
THE MATLAB MESSAGE IS:
Error: File: resol.m Line: 4 Column: 1
Function definitions are not permitted at the prompt or in scripts.
Error in ==> fsolve at 249
fuser = funfcn{3}(x,varargin{:});
Error in ==> asmma at 44
result=fsolve(@resol,X0)
Caused by:
Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.
pleaaaaase help me :'(