T O P I C R E V I E W |
JonasKlim |
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? |
5 L A T E S T R E P L I E S (Newest First) |
JonasKlim |
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
|
nick_n |
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 |
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
|
cpyang |
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
|
nick_n |
Posted - 10/08/2017 : 3:16:36 PM 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 |
|
|