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
 LabTalk Forum
 plotting with discontinous data.

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
jjangdori Posted - 07/14/2006 : 12:33:49 AM
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~~!!!
1   L A T E S T    R E P L I E S    (Newest First)
Deanna Posted - 07/14/2006 : 05:10:01 AM
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

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