I am trying to find the maximum and minimum values from a given set of data.
Show older comments
when I am using findpeaks command in Matlab I am only getting the peak value I also want the minimum value could you suggest which command I can use.I am also attaching the data file which includes one column of time and one column of stress signals.I have also attach the Matlab file,please find the attachment
Accepted Answer
More Answers (1)
Image Analyst
on 7 Oct 2017
To find the "valleys", simply invert the signal
[peakHeights, indexesOfPeaks] = findpeaks(stress);
[valleyHeights, indexesOfValleys] = findpeaks(-stress); % Note the minus sign!
valleyHeights = abs(valleyHeights); % Correct for inverting it.
4 Comments
Prateek Srivastava
on 20 Dec 2017
Image Analyst
on 20 Dec 2017
You say:
load(i+1:i+2)=[];
but load() is a function that takes a filename string. However you're using it as an array. The solution is simple: use a different name for your "load" variable so that it does not conflict with a built in function.
Prateek Srivastava
on 21 Dec 2017
Image Analyst
on 21 Dec 2017
Again, don't call it load. Call it thisLoad or something. Then to copy the ith element of that to s1, do this
s1 = thisLoad(i);
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!