Author |
Topic  |
|
bryansheng
China
Posts |
Posted - 03/19/2005 : 10:43:29 AM
|
Origin Version 7.0(Select Help-->About Origin): Operating System:win2000 It is known that statistics on column button can give you expected result.But i want to calculate other statistics not included in origin.How can i write my own function for my purpose.In addition,how to add the function in the origin? |
|
easwar
USA
1965 Posts |
Posted - 03/19/2005 : 2:34:14 PM
|
Hi,
You can use Origin C to write your own functions for any custom analysis. Origin C provides access to all Origin objects such as worksheets, graphs etc. See the following page for some examples: http://www.originlab.com/index.aspx?s=9&lm=71&pid=268
Also note that you can access the NAG library from Origin C and this library has many statistics functions.
Once a function has been coded in Origin C, it can be called from the script window, or it can be called from a user-defined button etc.
If you have specific questions on Origin C, please post in the Origin C forum.
Easwar OriginLab
|
 |
|
bryansheng
China
Posts |
Posted - 03/19/2005 : 9:18:42 PM
|
Thanks! But can i add user-defined button onto the shortcut menu? For example,if i choose a column of data and right-click it,then a shortcut menu pops.A Statistics on columns button is included.If clicking it,many statistics value is calculated.So i want to know whether i can add something on the function of the button in order to make user-defined function as a system default function.
|
 |
|
Mike Buess
USA
3037 Posts |
Posted - 03/20/2005 : 07:30:56 AM
|
The context menus are not programmable but you can program the regular menu bar menus. You could also create a toolbar button for the task.
Mike Buess Origin WebRing Member |
 |
|
easwar
USA
1965 Posts |
Posted - 03/20/2005 : 2:05:07 PM
|
quote:
So i want to know whether i can add something on the function of the button in order to make user-defined function as a system default function.
Hi,
What that menu item and the buttons do is to call a specific section of a specific script (.OGS) file. If you open the script window and hold the CTRL and Shift key down while you execute that context menu or click on the button, you will see in the script window: run.section(WKS,DescStats)
So you could then open the WKS.ogs file found in the EXE path of the Origin installation, go to the DescStats section of that file, and add additional script code which in turn can call a custom Origin C function. This way you could change the default behaviour.
Can you share with us what additional statistics you are looking for, so that we can consider adding that in a future version?
Easwar OriginLab
Edited by - easwar on 03/20/2005 2:05:37 PM |
 |
|
bryansheng
China
Posts |
Posted - 03/22/2005 : 9:19:51 PM
|
Thanks!I see. I want to calculate the fairness index of a dataset.It is defined as: FI=square(sum(xi))/sum(square(xi)),where 0<FI<=1.If FI approaches 1,it means fair. |
 |
|
|
Topic  |
|