필터 지우기
필터 지우기

I am trying to find the maximum and minimum values from a given set of data.

조회 수: 7 (최근 30일)
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

채택된 답변

Pedro Galvez
Pedro Galvez 2017년 10월 7일
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

추가 답변 (1개)

Image Analyst
Image Analyst 2017년 10월 7일
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
Prateek Srivastava
Prateek Srivastava 2017년 12월 21일
yeah I got your point that load is a function that takes file name string so what can I use to copy the ith element of the array "load" to the variable s1?
Image Analyst
Image Analyst 2017년 12월 21일
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);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by