Very basic question

Hello, I am starting Igor Pro (installed for a few minutes). I want to do something that I think is quite simple. I have 100 waves with one column of data only.

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!
function MakeAndAnalyze(i)
    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.
Here is an example of another way to do it:
Make/D/N=10 wave0=p, wave1=p+1, wave2=p+2
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.

Quote:
I find this program quite overwhelming.


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.
I am also quite new with Igor. I did all the introduction but still it is quite hard to get really familiar with Igor's way of thinking. Besides, it is sometimes very hard to find the right commands. This is easier e.g. in the Matlab help (but Matlab has other drawbacks...).

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)
hea wrote:

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.


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
hea wrote:

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)


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.
For searching documentation in Igor I usually use Help->Help Browser->Search Igor Files.
This performs a full text search. It might take a second or two but you find a lot of stuff.