undefined input argument using nlinfit
1 view (last 30 days)
Show older comments
Hi! i am using an nlinfit to determine a model parameter but i kept getting this error:
Input argument "data" is undefined.
even though i already defined the argument data. For clarity i will post the syntax here:
%input data;
%data [T(K) B(m3/gmol)];
data=[330 -9.7707
370 -7.3893
410 -5.6488
450 -4.3256
490 -3.2880
530 -2.4538
570 -1.7695
610 -1.1984
650 -0.71487
690 -0.30045
730 0.058557];
Gc=83.1451e-6;
Bact=data(:,2)
Tact=data(:,1)
unk0=[374 0.1 16]; %[Tc w Pc] in order, initial guess;
[unkhat resid J]=nlinfit(data,Bact,pct,unk0);
unkhat
the function pct is defined on a separate m-file.
is there anything i missed that i kept geting that error? i will gladly appreciate your help. thank you.
0 Comments
Accepted Answer
the cyclist
on 25 Jun 2011
Marineil,
I am confused a bit by your code. Because you did not include your definition of "pct", I created a simple one. When I do that, I do not get any error about the input parameter "data". I do get a warning about the resulting Jacobian, but I think that is because one of your X columns is defined as exactly the same as your Y column, in the call to nlinfit(). [I am wondering if you meant to just input "Tact" as the first argument to nlinfit(), rather than the whole array "data".]
Maybe you could also post your function definition for "pct", so that we can see exactly what you are running?
More Answers (0)
See Also
Categories
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!