| Author |
Topic  |
|
|
bjorn
Gothenburg, Sweden
18 Posts |
|
|
bjorn
Gothenburg, Sweden
18 Posts |
|
|
rtoomey
USA
184 Posts |
Posted - 04/22/1999 : 7:38:00 PM
|
Response to MAX/MIN choice
Bjorn,
Although I am not exactly sure what you mean by variables, I can offer you a suggestion based on my current understanding of your request:
It is possible to obtain the maximum and/or minimum value of any datasets by accessing the sum.min and sum.max object properties. To do so, you must first execute the sum(dataset) function on the dataset of interest. Just to let you know, selecting Analysis:Statistics on Columns runs the sum(dataset) function automatically (on the selected dataset(s) or range of selected dataset(s)).
If this information is not what you were looking for, please reply to this post and describe your situation in more detail. Perhaps then I will understand your situation better and can offer a more appropriate solution.
Sincerely,
Ryan Toomey
|
 |
|
|
rtoomey
USA
184 Posts |
Posted - 05/03/1999 : 7:08:00 PM
|
Follow-up to Mike Buess's response to MAX/MIN choice
Mike,
Thanks for the suggestion!
Bjorn,
In the hopes of making this task easier for you in the future, I have entered a suggestion in our database to add a MAX( ) function. I have included your name and e-mail address in case the developers need to contact you for further information. However, I expect that such a new feature will not be added to our upcoming release (Origin 6.0 - due out in mid-May) since it is so close to the release date.
Sincerely, Ryan Toomey Technical Support Engineer Microcal Software, Inc.
|
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 05/03/1999 : 7:50:00 PM
|
| Hi Bjorn, Ryan's suggestion might still work for you if you create the data set results={funcA,funcB,funcC}. Use sum(results) to get the maximum (as sum.max) and minimum (as sum.min) values. If you have a lot of functions, or if you're concerned about which of them actually yield the minimum and maximum values, it would be more convenient to name them func1, func2, func3, etc., rather than funcA, funcB, funcC. The following simple script uses the limit command instead of the sum function, because it also gives the indices of the minimum and maximum data set values. I've assumed that all functions have the single independent variable, var, but you should be able to extend it to any number of variables. Note: the limit command will change the values of x and y, so be careful about using them for your variable names in this example. /* first create a temporary data set with N elements */ N=10; /* the number of functions */ results=data(1,N); /* now fill that data set with the function results */ var=3; /* the variable value */ for(i=1;i<=N;i++) results[i]=func$(i)(var); /* find and report the values you want */ limit results; del results; type "max: func$(limit.imax)($(var))=$(limit.ymax)"; type "min: func$(limit.imin)($(var))=$(limit.ymin)"; The response in the script window should look something like this, max: func2(3)=10 min: func9(3)=0 I hope this helps, Mike Buess |
 |
|
|
Barb Tobias
USA
305 Posts |
Posted - 10/24/2000 : 3:40:00 PM
|
There are Release Notes available for each Origin patch (as well as each product release). I recommend you skim through the Release Notes when you apply a patch. Particularly, if you program with LabTalk, the Release Notes should be useful. The min( ) and max( ) functions were documented in the Release Notes for 6.0 SR2, SR3, and SR4 - and as Mike notes, they are documented in the 6.1 LabTalk Help file. For future Release Notes, we'll organize the LabTalk information better so that it will be easier to find LabTalk updates and changes.
|
 |
|
|
Mike Buess
USA
3037 Posts |
|
|
Jose
Netherlands
93 Posts |
Posted - 10/24/2000 : 8:22:00 PM
|
| Such functions, max() and min(), seem to be included in my Origin 6.0 SR2, although not reported anywhere. They return the maximum or minimum of a list of numbers, but they don't work with datasets the way sum() or limit do. This is, max(1,2,3,4)=; min(1,2,3,4)=; returns 4 and 1 respectively, but typing max(Data1_a)=; simply returns the first value of that dataset. I found this just trying... j. |
 |
|
|
Jose
Netherlands
93 Posts |
|
| |
Topic  |
|
|
|