Author |
Topic |
|
LordM00
Australia
5 Posts |
Posted - 11/03/2021 : 10:56:12 PM
|
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2020b (64-bit) 9.7.5.184 (Academic) Operating System: Windows 10
Hi,
I am trying to detect large signal jumps, similar to what is shown here: http://blog.originlab.com/detecting-jumps-in-signal-data
The issue is that I have a large number of sheets that I need to do this to, and I only care about the first jump. I am trying to define a function, and then use it in a sheet that has all of the other sheets that I want to apply this function to listed in a single column. This is similar to this method https://my.originlab.com/forum/topic.asp?TOPIC_ID=47009 to find maximum or minimum values in specific columns of many sheets.
To do this I have defined the following function Aset():
function double Aset(int nSheet) { range ra = [A1S]$(nSheet+3)!col(A); return idx(diff(ra)>1E-4)[0];
The way I think this should work is that it will look for any points in column A of the sheet numbered "nSheet + 3", where nSheet is the input, which have a difference between them and the next point of more than 1E-4, and then return the row index of the last point that it finds.
Unfortunately this does not seem to be working. Additionally, I want the first point to make this jump, not the last point. Is anybody able to determine the issues with my formula? If not, is there another method that would make this easier?
Thanks,
Michael |
|
Shirley_GZ
China
Posts |
Posted - 11/04/2021 : 03:00:48 AM
|
Hi Michael,
The function idx can only be used in Set Values dialog, https://www.originlab.com/doc/Origin-Help/Wks-SetColVal-QuickStart?f=dl I think this is the reason that your function doesn't work.
Please follow the instruction to call this function in Set Values dialog. If still problem, please send us the project file and all command lines.
Thanks, Shirley
Originlab Technical Service Team |
|
|
|
Topic |
|
|
|