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
 Origin - Column into Segments

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
chintan Posted - 06/05/2015 : 05:43:42 AM
OriginPro 8 SR4, Windows 7,64 bit.

Hi,

I am facing one issue. I have a data set of around 12078 values. I wanted to divide it into different segments with respect to series of data values (irrespective of index number) and put it into different vectors for analysis.

For example, when the value changes from 1.xxxx to 2.xxxx I have to collect it in a vector. I have to do it for all segments(value change from 1.xxx to 2.xxx, 2.xxx to 3.xxx, 3.xxx to 4.xxx etc ...). How should I do it ? Can you please help me with an example code.


Regards,
R.B.Dipu.


cmbhatt
2   L A T E S T    R E P L I E S    (Newest First)
chintan Posted - 06/09/2015 : 01:12:58 AM
Much thanks Mr. Jason.


cmbhatt
jasonzhao Posted - 06/08/2015 : 03:23:38 AM
Hello,

Please check with the example below:


int groupData(void)
{
Worksheet wks = Project.ActiveLayer();
vector sub0_1, sub1_2, sub2_3;  //vector to save data in range 0~1, 1~2, 2~3
Dataset source;
source.Attach(wks,0); //analysis for column 0
for(int i=0;i<source.GetSize();i++)
{
	int dd=(int)source[i];
	switch(dd){
	case 0:
	sub0_1.Add(source[i]);
	break;
	case 1:
	sub1_2.Add(source[i]);
	break;
	case 2:
	sub2_3.Add(source[i]);	
	break;
	}
}
return 0;
}


Best regards!
Jason
OriginLab Technical Service

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