I am a beginner of Igor pro. Is there a way to do operations (such as add, subtract, multiply some value) to all the data in a column? I know Origin can do that easily. Can Igor also? Thanks.
hi I know the post is a little old but I think my question fits in here. Does anyone know how to change the value of several waves at the same time, so eg multiply wave0 wave1 and wave3 by 5? I have lots of waves and dont want to type the command 100 times.
hi I know the post is a little old but I think my question fits in here. Does anyone know how to change the value of several waves at the same time, so eg multiply wave0 wave1 and wave3 by 5? I have lots of waves and dont want to type the command 100 times.
Thanks
You can also use the Data Browser for this. Select your waves in the data browser and then click the "Execute Cmd..." button. Then change the default "Display %s" command to your calculation, and use "%s" for the current selection, so as an example to add a value of 5 to the selected waves you would do the following:
%s+=5
Be sure the selection is only waves, as this will change the value of variables as well.
You can also use the Data Browser for this. Select your waves in the data browser and then click the "Execute Cmd..." button. Then change the default "Display %s" command to your calculation, and use "%s" for the current selection, so as an example to add a value of 5 to the selected waves you would do the following:
%s+=5
This was really helpful, thank you.
I know this post is old, but I have a related question : using the "%s" command it is easy to change Y values for waves, however I could not figure how to affect the X values.
I have a bunch of waves that need to be shifted in the X direction, is the same way as the Arithmetic package allows, but I wish to do it all at once for all the waves. Any idea ?
Just the same way as for y values:
Using the data browser, the following command is created using the %s syntax and "Execute once for all selected items". setscale/px, 5,10, "", root:w3,root:w2,root:w1,root:w0
This also works directly from the command line setscale/px, 5,10, "", w0,w1,w2,w3.
Note: All the waves will get the same "x-settings" (see displayhelptopic"Setscale" for details). To preserve individual features, you will need to run it one by one and recall the settings via DimDelta, DimOffset, DimSize, or WaveUnits for each wave.
Wave0 = Wave0 * 2 //multiply all the entries in wave0 by 2.
Wave2 = wave0 + 2*wave1 //add two times wave1 to wave0 and put the results in wave2
You should take the intro tour next:
December 23, 2010 at 07:48 pm - Permalink
December 29, 2010 at 07:05 pm - Permalink
Thanks
January 21, 2013 at 12:05 am - Permalink
String list // A semicolon-separated list.
String theWave
Variable index=0
do
theWave = StringFromList(index, list)
if (strlen(theWave) == 0)
break // Ran out of waves
endif
wave w = $theWave //create wave reference
w *=5
index += 1
while (1) // Loop until break above
End
then execute e.g.;
This techniques ist described in the manual, just execute
January 21, 2013 at 02:49 am - Permalink
You can also use the Data Browser for this. Select your waves in the data browser and then click the "Execute Cmd..." button. Then change the default "Display %s" command to your calculation, and use "%s" for the current selection, so as an example to add a value of 5 to the selected waves you would do the following:
%s+=5
Be sure the selection is only waves, as this will change the value of variables as well.
January 21, 2013 at 09:13 am - Permalink
February 4, 2013 at 09:29 am - Permalink
This was really helpful, thank you.
I know this post is old, but I have a related question : using the "%s" command it is easy to change Y values for waves, however I could not figure how to affect the X values.
I have a bunch of waves that need to be shifted in the X direction, is the same way as the Arithmetic package allows, but I wish to do it all at once for all the waves. Any idea ?
Thanks
April 26, 2018 at 10:42 pm - Permalink
Using the data browser, the following command is created using the %s syntax and "Execute once for all selected items".
setscale /p x, 5,10, "", root:w3,root:w2,root:w1,root:w0
This also works directly from the command line
setscale /p x, 5,10, "", w0,w1,w2,w3
.Note: All the waves will get the same "x-settings" (see
displayhelptopic "Setscale"
for details). To preserve individual features, you will need to run it one by one and recall the settings viaDimDelta, DimOffset, DimSize,
orWaveUnits
for each wave.HJ
April 27, 2018 at 12:41 am - Permalink