I am trying to make a data fit for the data attached to this post,Nu=f(Re,Theta,Beta).I use lsqnonlin(fun,x0) function for this purpose.I have created a script file for this fitting,but everytime I try to run the script,the program always shows error messages.So,what is the problem with this script.
clcclear all% Create an anonymous function that describes the expected relationship
% between X and Y
f=@(c,x) c(1).*(x(:,1).^c(2)).*(x(:,2).^c(3)).*(x(:,3).^c(4))./x(:,4)-1;% data set
% Specify x variables from data file,Re,Theta and Beta columns.
x=xlsread('all data for fitting');% Specify y variable from data file ,(Nu)column.
y=x(:,4);% Specify a vector of starting conditions for the solvers
c0=[1;1;1;1];% Perform a nonlinear regression
c=lsqnonlin(f,c0);
Best Answer