I have a dataset in which I have three independent variables in a function to give an output, the code for which is given as follows:
ip = [791.3080768 27.77748384 0.022016716
763.1277705 24.17306411 0.020330783
616.5766311 11.13145056 0.012707747
448.0010846 3.698850278 0.011639681
op = [28;23.2;10;4.3];
fun = @(c,x) c(1)* ip(:,2).^c(2) .* exp(ip(:,1)./c(3)) .* ip(:,3).^c(4);
[beta,R,J,CovB,MSE,ErrorModelInfo] = nlinfit(ip,op,fun,rand(4,1));
When I try to run it in MATLAB, I get the following error: "The function you provided as the MODELFUN input has returned Inf or NaN values."
I am not sure why is this happening, I have checked the input data in "ip" but can't seem to find the solution. It would be really great if someone here can help me with it.
Thanks in advance!