Very basic question
mastervan
1. I would like to find the maximum of each wave
2. I would like to find the value at a given index
3. I would like that these data appear in a new table with X column being the waves and Y column the max value (or the value at a given index).
Can you help me? I find this program quite overwhelming..
Thanks!
variable i // selected index
make/O/N=(100,2) results // wave for maxima and values at 'i'
string swave
variable j
for(j=0;j<100;j+=1) // this example creates the data waves;
// otherwise they might be loaded from a file
swave = "wave"+num2str(j) // name the waves in sequence
make/O/N=500 $swave
wave temp = $swave
setscale x, 0, 1,"" temp // a particular exmple for demonstration
temp = j*cos(j*2*pi*x)
results[j][0] = WaveMax(temp) // maximum in column 1
results[j][1] = temp[i] // indexed value in column 2
endfor
end
In the command line, just type in: MakeAndAnalyze(IndexValueYou Want)
You can view the results in a Table (using Edit) or appropriate Graph.
If you are a brand new user, the best way to learn Igor is to take the Guided Tour. Otherwise, the example above will not be of much help, since it uses many different Igor basic concepts.
March 25, 2012 at 05:26 pm - Permalink
Edit wave0, wave1, wave2
Make/D/N=3 maximums
AppendToTable maximums
maximums = WaveMax(WaveRefIndexed("Table0", p, 1))
Make/D/N=3 valuesAtIndex
AppendToTable valuesAtIndex
valuesAtIndex = WaveRefIndexed("Table0", p, 1)[5] // Values at point 5
This works for 1D, scalar (not complex), numeric (not text) waves only.
As s.r.chinn said, it's essential to do at least the first half of the Igor guided tour. It will make the program considerably less overwhelming. Choose Help->Getting Started.
March 26, 2012 at 09:22 am - Permalink
For this question (particularly #1) I would not know how to find the command "wavemax" without Google and this Forum. For me, it would have simplified the search if there was a link to "WaveMax" in the "max" entry in the Igor Reference.ihf file.
And it is the same for "WaveMin" and "min" (indeed, this was my actual problem)
August 11, 2016 at 12:33 am - Permalink
I agree. The commands could benefit by expanding cross references to other comparable functions. I can however also point out, the PDF manual shows these links in the index ...
* maximum among several waves --> WavesMax user-defined function III-148
* maximum location in wave V-323, V-822
* maximum of wave V-824
* minimum location in wave V-323, V-822
* minimum of wave V-824
Interestingly, the index links for maximum of wave and minimum of wave should probably point to V-817 instead of V-824 (this is for v6.37 of Igor Pro).
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
August 11, 2016 at 04:35 am - Permalink
I've added a request to our documentation tracker to have this done for Igor Pro 7.
For anyone using Igor Pro 7, it's even easier to find the appropriate command. Open the Help Browser and select the Command Help tab (you can use the Help->Command Help menu item to get here directly).
Under the list at the left is a filter by name field. Type in "max" and the topic list will be filtered so that only commands whose name includes "max" are shown. This includes WaveMax.
August 11, 2016 at 01:01 pm - Permalink
This performs a full text search. It might take a second or two but you find a lot of stuff.
August 12, 2016 at 06:25 am - Permalink