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
 how to choose the row that I want ?

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
nabilou Posted - 01/18/2013 : 10:23:06 AM
well my problem is the following:

I have 3 columns, A, B and C
A is X: x
B is Y: f(x)
Y is C: g(x)

knowing that f(x) depends on g(x) as follow:

f(x) = 1/Ln(g(x))
g(x) = [(f(x)/a)^(-1/2)]*b

I need to plot the two curves, but it was not easy because the two are not independent.

by cons, I thought of a solution to the problem. If I know the two initial values of f(x) and g(x), I can do it.

here's how:

A; B; C
1; b1=5; c1=3;
2; b2; c2;
3; b3; c3;
4; b4; c4;
5; b5; c5;

therefore, to calculate the value b2, I should use c1 = 3 , and to calculate the value c2 I should use b2. to calculate the value b3, I should use c2, and to calculate the value c3 I should use b3. and so on

the problem now is that I do not know how I do ...!
should I use set values ? C++ ? LabTalk ?


Thanks
1   L A T E S T    R E P L I E S    (Newest First)
Cecilia_syy Posted - 01/21/2013 : 02:25:01 AM
Hi
You can build a function by using Code Builder in Origin. Set 3 vector to present the 3 columns. Then you should use a loop to calculate with the initial values. You can refer to the following code.

ForumProblem(int PointNum, double a, double b)
{
	vector x(PointNum),f(PointNum), g(PointNum);
	//initial values
	x[0]=1;
	f[0]=5;
	g[0]=3;
	
	for (int i=1;i<PointNum;i++)
	{
		x[i]=x[i-1]+1;
		f[i]=1/ln(g[i-1]);
		g[i]=(f[i]/a)^(-0.5)*b;
		
	}
	//Create worksheet.
	Worksheet wks;
	wks.Create(); 
	Page pg = Project.Pages(-1);
	
	////import to worksheet.
	Dataset dsX, dsY1, dsY2; 
	dsX.Attach(wks, 0);  
	dsY1.Attach(wks, 1); 
	wks.AddCol();
	dsY2.Attach(wks, 2); 
	dsX = x;
	dsY1 = f;
	dsY2 = g;
		
}


Cecilia
OriginLab Corp.

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