The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Pass by value parameters

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jfrorigin Posted - 12/29/2010 : 12:54:07 PM
Origin 7.5 SR2 on XP.

Hi,

I use the NonLinear Curve Fitting with a user defined C function.
This function is defined via the code builder.

myfun(double P1, double P2, double x, double & y)
{

P1=P1*1.0e-9;

// Here is the body of the function itself
//
}

I fit with P2 by keeping P1 constant to a value val0 in the graphical interface. However the fit does not converge properly.

If I remove the line P1=P1*1.0e-9; in the program and fit by keeping P1 constant to val0*1e-9, the fit works perfectly.

Is it forbidden to change the value of one parameter in the body of the fit function? I thought it would be ok, since parameters are passed by value and not by reference.

Hope you can help.

Thanks

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000