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
 get number of rows

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
ase724 Posted - 11/05/2012 : 4:26:55 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.6
Operating System: Windows7

Hi,

I am trying to do curve fitting using an external dll function. I am using Visual Studio 2010 to write the C code for the dll function. I need to know the number of rows in the worksheet in order to do the calculation. Each data set (each worksheet/workbook) has several columns with the same number of rows, however, each data set was taken for various time period so different data set contains different number of rows. How do I write the C code (in the dll function) to get the number of rows in the worksheet? Thanks in advance!

3   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 11/07/2012 : 03:17:22 AM
Hi,

You can see the definition in the FitFuncDef.h file, and x is for the input independent variables, that is to say, x[1] is for the first independent variable, x[2] is for the second, etc. The example you mentioned is the fitting function for two independent variables. So, it is not the thing like array or vector you mentioned. Also, it is not able to make the variables (x1 and x2), as you mentioned, become array or vector.

Penn
ase724 Posted - 11/06/2012 : 02:33:04 AM
Hello Penn,

Thank you very much for your quick reply. I have another difficulty in dll fitting function. I want to fit a function y (one column in my worksheet) with two variables, x1 and x2 (two columns in my worksheet). In my calculation I use 2D arrays so I want to set variables x1 and x2 as arrays. The dll fitting example from Origin has the syntax:

#define x1 x[1]
#define x2 x[2]

but when I compile it the computer doesn't recognize them as arrays. Is there a way to make the variables become arrays or vectors? Thanks!
Penn Posted - 11/06/2012 : 12:59:55 AM
Hi,

The external dll function is not dependent on Origin, so, it is not able to get the number of rows in the worksheet. However, you can try the workaround by adding one more parameter for your fitting function, and this added parameter will be the number of rows of the worksheet. And when you uses this dll to perform fitting, you can specify this parameter with the number of rows in worksheet, and then fix this parameter.

Penn

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