I am trying to find the maximum and minimum values from a given set of data.
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Prateek Srivastava
le 7 Oct 2017
Commenté : Image Analyst
le 21 Déc 2017
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
0 commentaires
Réponse acceptée
Pedro Galvez
le 7 Oct 2017
Hello!
Maybe you can first import the data into a vector and then look for the maximum and minimum like this:
A=importdata('sl.txt');
B=A.data;
mx=max(B(:,2))
mn=min(B(:,2))
This code should work!
Pedro
Plus de réponses (1)
Image Analyst
le 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 commentaires
Image Analyst
le 21 Déc 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);
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!