Author |
Topic |
|
JonasKlim
Lithuania
36 Posts |
Posted - 10/08/2017 : 08:06:20 AM
|
Hi, A as long time user of Excel I am curious if different formulas can be used for calculation of values of different cells of the same column. For example, C[1]= max(A), C[2]= min(A). If yes, how to write a script? |
Edited by - JonasKlim on 10/08/2017 08:07:11 AM |
|
nick_n
Finland
125 Posts |
|
cpyang
USA
1406 Posts |
Posted - 10/08/2017 : 8:29:40 PM
|
In the upcoming Origin 2018, that would be exactly what you do,
put "=max(A)" into C[1] and "=min(A)" into C[2].
CP
|
|
|
JonasKlim
Lithuania
36 Posts |
Posted - 10/09/2017 : 05:21:49 AM
|
Hello, Nikolay, Thank you. Now I understood the trick: while in dialog window, I have to put the cursor on the cell I want to enter formula and then edit the formula in dialog window. Could you please help with one more issue: if I write an expression to calculate row number, like "P[1]=list(min((F[60:160]));F)", and then use P[1] as an input to calculate simple formulas, like N[1]=K[P[1]+5], it works fine. But, if I try to do the same with functions, like changing fixed row numbers in formula "list(min(G[0:55]);G[0:55])" to calculated row numbers in "list(min(G[0:P[1]]);G[0:P[1]])", I do not get result. Regards, Jonas
quote: Originally posted by nick_n
Hi,
For your example it will be: col(C)[1]=max(col(A)); and col(C)[2]=min(col(A));. See more at http://www.originlab.com/doc/LabTalk/ref/Col-func.
Moreover, pay attention for ranges (http://www.originlab.com/doc/LabTalk/guide/Range-Notation). They provide access to any book, sheet, or plot. BR,
Nikolay
|
|
|
nick_n
Finland
125 Posts |
Posted - 10/09/2017 : 3:55:08 PM
|
Hi, First of all, sorry for confusing. I thought that you tell about LabTalk script, whereas it was "Set value" dialog. Both of them are powerful features and have some basic similarities. Nevertheless, there are some differences in using. However, "Set value" is much more easy to use, LabTalk gives more flexibility (it's my personal opinion).
Well, in this case I would prefere to use LabTalk, just simple run from Script window (Alt+Shift+3 to open). Put there your script like: col(P)[1]=list(min(col(G)[1:55]), col(G)[1:55]); select your script e.g. Ctrl+A, press Enter. Regards,
Nikolay |
|
|
JonasKlim
Lithuania
36 Posts |
Posted - 10/12/2017 : 01:25:07 AM
|
Hi, Nikolay, Thank you. I started using LabTalk. Best regards, Jonas
quote: Originally posted by nick_n
Hi, First of all, sorry for confusing. I thought that you tell about LabTalk script, whereas it was "Set value" dialog. Both of them are powerful features and have some basic similarities. Nevertheless, there are some differences in using. However, "Set value" is much more easy to use, LabTalk gives more flexibility (it's my personal opinion).
Well, in this case I would prefere to use LabTalk, just simple run from Script window (Alt+Shift+3 to open). Put there your script like: col(P)[1]=list(min(col(G)[1:55]), col(G)[1:55]); select your script e.g. Ctrl+A, press Enter. Regards,
Nikolay
|
|
|
|
Topic |
|
|
|