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
 Short Question to curve_xfromY

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
Kstadler Posted - 08/22/2007 : 10:21:42 AM
Origin Version (Select Help-->About Origin): v7
Operating System: Windows 2000

Hi,

during programming a function to find the 20 and 80% values of
a slope of a peak I encountered the following problem:
The function curve_xfromY() gives me the x value of a specified y,
but when I have several equal y values at different x values, Murphy's law demand its right and a get the "wrong" x value.
Can I somehow tell curve_xfromY that it should take a value "near" a certain index or x value?

Many thanks in advance
Konstantin Stadler
4   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 08/30/2007 : 10:43:23 PM
Yes, curve.h is a new header in Origin 7.5. Maybe you can download a demo 7.5 to get all new .c and .h files? :-)

Thanks
Larry
OriginLab Technical Services

Edited by - larry_lan on 08/30/2007 10:43:52 PM
Kstadler Posted - 08/23/2007 : 06:27:34 AM
Hi rlewis,

I tried to make a curve copy, but then I got the following Error Massage:
Error, Can't find matching constructor
probably because I do not have a curve.h in my system folder.
I use v7.0383 (B383) - could it be, that curve.h is a new header for v7.5?

Many thanks,
Konstantin
zachary_origin Posted - 08/22/2007 : 7:52:44 PM
Perhaps you can add a new curve_xfromY() function with different parameters from the default one as your own need...
The corresponding files for the declaration and definition are data.h and internal.c, which are both located in the folder of OriginPro75_Installation_Folder\OriginC\system\.

rlewis Posted - 08/22/2007 : 10:47:29 AM
How about constructing a temporaty curve withing the given x range and then using curve_xfromY ....
In principle this could be doable with the following curve constructor that I lifted from the help section

Curve::Curve
Prototype: PUBLIC Curve(curvebase &cv, int &nNumMissingInCopy, int &nSrcOffset, DWORD dwOptions = 0, int nLower = -1, int nUpper = -1)

Remarks: It creates a temporary curve object from the supplied source.

Parameters: cv = [in] source curve
nNumMissingInCopy = [output] number of missing values in the created curve.
nSrcOffset = index in source curve that the result curve's 1st point is copied from
dwOptions = a combination of values from the enumeration:
enum {
CURVECOPY_SCAN_OVER_MISSING_FROM_LEFT = 0x00000001, // if on, it will scan from the left (see the parameter nLower) until it finds the first nonmissing value
CURVECOPY_SCAN_OVER_MISSING_FROM_RIGHT = 0x00000002, // if on, it will scan back from the right (see the parameter nUpper) until it finds the first nonmissing value
CURVECOPY_SKIP_MISSING_INSIDE = 0x00000004, // if on, it will not copy any missing values found in the middle
CURVECOPY_REPLACE_MISSING_INSIDE = 0x00000008, // if on, any missing values in the middle will be replaced with the average of neighboring points (not used if the bit CURVECOPY_SKIP_MISSING_INSIDE is on)
};
nLower = lower index to start from or -1 to start from the lower bound.
nUpper = upper index to end at, or -1 to end at the upper bound.


Return values:

Example:


Summary:
Sample data:
Header file: curve.h
See also:

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