help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading mat file


From: Doug Stewart
Subject: Re: Reading mat file
Date: Wed, 21 Mar 2012 08:06:26 -0400



On Wed, Mar 21, 2012 at 5:59 AM, asha g <address@hidden> wrote:
Andrew,
this is great.Now I want all the peak values - I have about 3- 4 maxima for x= 55 .
How do I get this program to give me all the peak values and the corresponding x values. Here  it is selecting one value of the entire lot. 

Thanks
Asha
 
 
 
 

[val,idx] = max(vv1);
max_x = x(idx);

if you run "help max", you'll see that it can pass two outputs: the first is
the actual maximum, and the second is the "first index of the maximum
value".  The min function can do the same thing.

Oh, and to display the contents of a variable in MATLAB/octave, you don't
*have to* use disp.  Just type the variable name at the prompt and hit
enter; this tells the program to print the contents to the screen.

Andrew

--


Asha:

  If you want to find a local max and not the global max, then you must specify the local region that you are interested in.

example:
[val,idx] = max(vv1(1:200));
max_x = x(idx);

Would find the local max in the first 200 data point of vv1



--
DAS

https://linuxcounter.net/user/206392.html

reply via email to

[Prev in Thread] Current Thread [Next in Thread]