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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 plotting with discontinous data.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jjangdori

S. Korea
Posts

Posted - 07/14/2006 :  12:33:49 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7
Operating System: windows xp home edition SP2

I have 19 worksheets which have 2 columns and 5 rows.

1) I want to plot a graph with 2nd, 4th and 5th data of each worksheet.

2) I want to fit linear of 1) all.

3) I want to save automatically the slopes and errors of linear fit.

4) I want to plot the slopes and erros on a graph.

How can I do that??

plz. help me..

I've never used computer programming... help me~~!!!

Deanna

China
Posts

Posted - 07/14/2006 :  05:10:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Do you want to perform linear fit on 6 points exacted from each worksheet? It means 19 fitting procedures will be required. If I did not get you wrong, the following Labtalk script should be able to do the job. You can paste it into the Script Window and execute.


create worksheetname -s 19;
jj=1;
doc -e w
{
worksheetname[$(jj)]$=%h;
jj++;
};

//Create a new worksheet to hold the data
create FitData -wn 6;
worksheet -a 18;
col(1)=data(1,6);

//Create a new worksheet to hold the result
create FitResult -wn 19 Index Slope Error;
col(1)=data(1,19);

//Copy data
for (ii=1; ii<jj; ii++)
{
%j = worksheetname[$(ii)]$; //The name of worksheet
%a = %j!wks.col$(1).name$; //The name of Column 1
%a = %j_%a;
%b = %j!wks.col$(2).name$; //The name of Column 2
%b = %j_%b;
%z= FitData!wks.col$(ii+1).name$;
%z=FitData_%z;

%z[1]=%a[2];
%z[2]=%b[2];
%z[3]=%a[4];
%z[4]=%b[4];
%z[5]=%a[5];
%z[6]=%b[5];

win -t plot scatter; //Create a new graph page
layer -i %z ; //add data to layer
layer -a; //rescale axes to show all data

lr %z;
FitResult_Slope[$(ii)]=lr.a;
FitResult_Error[$(ii)]=lr.sd;
};

//Plot the result
win -t plot scatter; //Create a new graph page
layer -i FitResult_Slope ; //add data to layer
layer -a; //rescale axes to show all data

win -t plot scatter; //Create a new graph page
layer -i FitResult_Error ; //add data to layer
layer -a; //rescale axes to show all data




Deanna
OriginLab GZ Office
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000