Hello! I am using Origin 6.0 and as an origin beginner I am not very familiar with all the functions. I have a relativly simple task, I need to fill an empty column with the highest value of an existing column. So I open the dialoge box "set column values" but then I don't find a function to display the maximum value of a certain column! Can anybody helb me? Best regards, Selinger 78
Probably easiest to use LabTalk's sum() function. Say you want to find the largest value in col B and set all rows in a new col named Max to that value...
wo -v Max; // create col Max if it doesn't already exist col(Max)=col(B); // give it some initial values sum(col(B)); // find sum.max, sum.min, sum.total, etc col(Max)=sum.max; // set all rows in col Max to maximum value col B
...You'll need to run those commands from the script window rather than the Set Column Values dialog.
Thanks for the fast answer! However, I somehow cannot execute such a script, when I type "run" I get an error message that says "the initial configuration script file is missing or not in the directory". How do I have to continue in such a case? Best regards, selinger78
A command or series of commands typed in the script window is executed automatically when you press Enter. Copy the four command lines from my previous post to your script window, select (highlight) all four lines and then press Enter.
You can do this partially with the Set Column Values dialog after all. Start by finding the maximum value from the script window...
sum(col(B))<Press Enter>
Now open Set Column Values dialog and enter the expression sum.max for the Col(Max) value.
...There is an easier way to do this if Origin 6.0 has a Normalize command on the context menu for columns. (I don't remember whether or not it does.)
1. Right-click on the column from which you want to obtain the max value and select Normalize (if it exists) on the resulting menu.
2. The default value offered in the Normalize dialog is the max value. Copy (Ctrl+C) that value to clipboard. Then press Cancel to close the dialog.
3. Open the Set Column Values dialog for the column in which you want to put the max value. Paste (Ctrl+V) the value from the clipboard into the expression box.