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
 "Error! No column exists. Create it first."

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
tony_lincoln Posted - 09/03/2006 : 12:01:20 AM
Dear Friends,
I am using the demo codes provided by OriginLab.com to do curve fitting (see the following codes). But when I run it with the input of one txt file name, it says "Error! No column exists. Create it first.".
In this txt file there are two columns, one is time, for x axis, the other column is collected data, for y axis.
Then I copied these two columns from txt file into the worksheet of origin software and saved this worksheet as *.ogw. But when I run the codes with this ogw file, the same error appears!
Where was wrong?
Thanks.
Tony

[/CODES]

void fit(String strCurve)
{
using NLSF = LabTalk.NLSF; // Point to the NLSF object
NLSF.Init(); // Initialize the fitter
NLSF.Func$ = "gaussamp"; // Assign fitting function
NLSF.FitData$ = strCurve; // Assign dataset name
NLSF.Execute("parainit"); // Perform automatic parameter initialization
NLSF.Fit(100); // Perform fit - up to 100 iterations
NLSF.PasteParams("p"); // Paste fit results to graph
}


void test()
{
string strFile = InputBox("Input the file full name please:");
fit(strFile);
}

[/CODES]
3   L A T E S T    R E P L I E S    (Newest First)
Deanna Posted - 09/10/2006 : 9:33:57 PM
Hello, Tony.

The value assigned to nlsf.fitdata should be full name of the dependent variable, for example, Data1_A, where Data1 is the worksheetname and A is the column name.

I am not sure what strCurve is in your code. Is it the a full name? If you know the worksheet name (strWorksheetName) and column name (strColName) of the data to be fitted, you can use the following code to assign nlsf.fitdata$.

string strDSName;
strDSName.Format("%s_%s", strWorksheetName, strColName);
nlsf.fitdata$ = strDSName;


In addition, NLSF.funcx$ is for setting a column as the X column to create the end result dataset. It can be automatically generated and assigned; therefore, it is not a must to assign it.


Deanna
OriginLab GZ Office

Edited by - Deanna on 09/10/2006 10:11:20 PM
tony_lincoln Posted - 09/08/2006 : 7:36:53 PM
Hi Mike,
THanks a lot for your words. But how to select Y column automatically?
I used the codes in my Origin C codes:
Worksheet exp(strCurve);
NLSF.funcx$ = exp_A; //use as X dataset
nlsf.fitdata$ = exp_B;
But it did not work...
Thanks.
tony
Mike Buess Posted - 09/03/2006 : 05:39:41 AM
Hi Tony,

Are you sure that's the complete code? It doesn't make sense because the test function passes a file path\name to the fit function but the latter wants a dataset name (wksName_colName). I have the feeling that the full code will import the text file to an empty worksheet and fit the second column. Anyway, since you already have the data in a worksheet you can do the following...

1. Select the Y column.
2. Enter the following code in the script window.

fit(%C); // fit the selected dataset
layer -a; // rescale graph

Mike Buess
Origin WebRing Member

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