
Dividing all waves in a folder by a value

mespri
Hi guys,
I have a problem, which might be very easy to solve. I have a folder with waves and I want to divide all waves by the factor 1000 using the following function:
Function NormalizeAll() Variable n=ItemsInList(wavelist("*",";","")) Variable i For (i=0; i<=n; i+=1) $(StringfromList(i,wavelist("*",";","")))=$(StringfromList(i,wavelist("*",";","")))/1000 EndFor End
The error is: "Can't use $ in this way in a function". I am confused, because I have used the $-trick in a function before. If I put the line in the for loop in the commander for a specific value of i, it works. Thank you for your help!
You have to declare the wave first
December 15, 2022 at 06:36 am - Permalink
Thank you <3
December 15, 2022 at 06:47 am - Permalink
For your curiosity here is another way of accomplishing the same thing with different commands
December 15, 2022 at 08:35 am - Permalink
Hi,
Depending on how often you need the command, don't forget the ability to execute a command in the data browser.
Select all the waves of interest and then in the execute command dialog:
%s /=1000
Andy
December 15, 2022 at 08:46 am - Permalink
Here's a GUI for normalizing waves
December 16, 2022 at 03:26 am - Permalink