| T O P I C R E V I E W |
| cellbiophysics |
Posted - 03/08/2008 : 09:24:28 AM Origin Version (Select Help-->About Origin): Origin 8 Operating System:Window XP
I'm trying to use kind of user-defined function in Origin C, called "func". I wrote a code like C-language but it didn't work. My code is as follows;
==================================================================== #include <origin.h>
double dSum = 0; int ser=nser;
double func(int ni, double xi, double ti) { double fi; fi = ni^2*xi+xi^3(ni+2*ti); return fi; } for(int n = 0; n < ser; n++) { dSum += (-alp*bt)^n*((1-f)*func(n,x,t1)+f*func(n,x,t2)); } y = A*dSum; ====================================================================
, where the fitting parameters are A, alp, bt, f, t1,and t2. nser is set to fixed value. But, there are some errors in compiling. The errors occurred at "double func(int ni...)". The error messages are as follows;
==================================================================== compiling... _nlf3D_slow_080224.fit FEEDBACK macros not defined D:\OriginC\NLSF\_nlf3D_slow_080224.fit(42) :Error, invalid declaration D:\OriginC\NLSF\_nlf3D_slow_080224.fit(42) :Error, general compile error D:\OriginC\NLSF\_nlf3D_slow_080224.fit(30) :Error, error(s) found in compiling function _nlsf3D_slow_080224 ====================================================================
Please let me know what's wrong. How can I fix it? Thanks,
KB.
Edited by - cellbiophysics on 03/09/2008 9:04:59 PM |
| 2 L A T E S T R E P L I E S (Newest First) |
| cellbiophysics |
Posted - 03/11/2008 : 03:25:05 AM Dear Deanna,
Thanks! Ooops! It's my mistake. :-) it works!
KB |
| Deanna |
Posted - 03/11/2008 : 01:26:13 AM Hi KB.
Please move your function outside the nlsf function, as in the screenshot below:

In addition, a "*" is missing after "xi^3" in your func.
Deanna OriginLab Technical Services |
|
|