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
 Sort X Y dataset

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
peter.cook Posted - 09/03/2004 : 11:14:51 AM
Hi,

Can anyone please tell me how to sort an X-Y dataset eg created by 'create petesdata -c 10'. I can only think of a way using data_sort but I seem to have to copy data to a worksheet first in order to perform this fuction. I would really like to avoid this.

Cheers,

Pete

5   L A T E S T    R E P L I E S    (Newest First)
peter.cook Posted - 09/03/2004 : 2:39:59 PM
Hi,

Thanks for reply. I do use eg %T for temp variables. Can use workaround now I know. The particular example was using multiple graphs and fitcol$(ng) referred to curve data for each graphs eg ng=1 to 12.

Cheers,

pete

cpyang Posted - 09/03/2004 : 12:53:28 PM
I think that was never supported, as long as you can see the work around, better just do that. With string variables, those %T etc should no longer be used to hold anything other than a temp variable. I understand in the past, many of such %T, %M etc might be holding longer term values that prevented them from being used anywhere to just as a temp variable.

CP


peter.cook Posted - 09/03/2004 : 12:26:51 PM
Hi CP,

A problem I had was that OCSortXYDataSet fitcol$(ng)_a fitcol$(ng); doesn't work. I had to use %T=fitcol$(ng); OCSortXYDataSet %T_a %T;

Why is this?

Thanks,

Cheers,

pete

peter.cook Posted - 09/03/2004 : 12:03:34 PM
Thanks CP!

I hadn't browsed/scrolled through the help properly.

Cheers,

Pete

cpyang Posted - 09/03/2004 : 11:50:04 AM
Use Curve, as can be seen below


void dd()
{
LT_execute("create petesdata -c 5");
LT_execute("petesdata = {1,2,3,4,5}");
LT_execute("petesdata_a = {2,3,4,5,1}");

Curve cc("petesdata_a", "petesdata");
cc.Sort();
for(int ii = 0; ii < cc.GetSize(); ii++)
{
printf("%d:%f\n", ii+1, cc[ii]);
}
}





CP



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