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
 Reorder for Curves, and some follow up issues

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
Frank_H Posted - 12/08/2005 : 6:47:20 PM
Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System: Win XP

When using Reorder for Curves (it inherits it from vectorbase), only the y-dataset is reordered, the x is untouched. Then I end up with wrong combinations of x/y. Any suggestions to avoid this?

Perhaps there's also a simpler way to do what I am trying at the moment: I am using Reorder to reverse (mirror) a Curve. Is there a more direct way to do this? It's necessary as some of my data has monotonic falling x, and many of the analysis functions don't like that but expect monotonic rising x.

I don't like to use sort as I know, that my data is monotonic, and therefore a sort algorithm is really an overkill.

I could use a 1xN matrix and Flip. But then I have to access the x-data. Is there a more elegant way to do that beside extracting the name of the x-dataset with HasX and then construct the dataset with this name? I am missing any direct access to the x-Dataset of Curves!
1   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 12/09/2005 : 09:54:26 AM
Hi,

If your curve is derived from datasets in a worksheet, then easiest is to use the Sort() method in curvebase class.

Say you have your X, Y data in columns 1 and 2 of the active worksheet and your X is in descending order and you want to flip so that X becomes asending order and Y is properly arranged as well. You can then use code such as:


void sort_curve()
{
Worksheet wks = Project.ActiveLayer();
Curve crv(wks, 0, 1);
crv.Sort();
}



The key is to use the correct Curve constructor. Note that some curve constructors (such as creating curve using dataset name) make a copy and then in that case original curve does not get changed.

Easwar
OriginLab


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