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
 calculating the halfwidth of gaussian peak
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

sshkrv

USA
4 Posts

Posted - 05/21/2014 :  09:56:05 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
hi guys, can u help me please with making a script? I got these spetra (posted image). And i tried to get the hafwidth of each. But I didn't get how to make it for each (each column) of them, using a cicle.

the only script i got is written below



the script

min1_index = 1;
min1 = %c[1];
for(i=2; i<=390/2; i++) {
if(%c[i] < min1) {
min1 = %c[i];
min1_index = i;
};
};

for(i=1; i<=min1_index; i++) {
%c[i] = 0;
}

min2 = %c[390/2];
min2_index = 390/2;

for(i=390/2; i<=390; i++) {
if(%c[i] < min2) {
min2 = %c[i];
min2_index = i;
};
};

for(i=min2_index; i<=390; i++) {
%c[i] = 0;
}


this one removes tails

ssh




thanks for your attention

Edited by - sshkrv on 05/21/2014 10:01:44 AM

lkb0221

China
497 Posts

Posted - 05/21/2014 :  5:17:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can try doc -e DY {script} to loop through all data plots in the current graph window.

During the script, %H contains the window name and %C the dataset name in each iteration.

Zheng
OriginLab
Go to Top of Page

sshkrv

USA
4 Posts

Posted - 05/23/2014 :  5:58:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by lkb0221

Hi,

You can try doc -e DY {script} to loop through all data plots in the current graph window.

During the script, %H contains the window name and %C the dataset name in each iteration.

Zheng
OriginLab



thank you! but can you give an example of code, using this function, please?

ssh
Go to Top of Page

lkb0221

China
497 Posts

Posted - 05/27/2014 :  3:42:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I think you just need to put the script you posted into the bracket, for example:

doc -e DY
{
min1_index = 1;
min1 = %c[1];
......
%c[i] = 0;
}
}

Zheng
OriginLab
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