필터 지우기
필터 지우기

find the lowest value in a selection of data

조회 수: 1 (최근 30일)
C.G.
C.G. 2021년 10월 21일
편집: Scott MacKenzie 2021년 10월 21일
I have a matrix of data where I am working with columns 5 and 6. I have divided the data into sections based on the values of column 5.
Now for each of the variables S1-S4, I want to find the lowest value of column 6 that occurs in each variable, and save both the values in columns 5 and 6 that correpsond to this and plot the values on a graph.
S1 = T(:,5) >0.13;
S2 = T(:,5)>= 0.115 & T(:,5) <= 0.129;
S3 = T(:,5)>= 0.1 & T(:,5) <= 0.114;
S4 = T(:,5)>= 0.084 & T(:,5) <= 0.09;
  댓글 수: 4
Scott MacKenzie
Scott MacKenzie 2021년 10월 21일
편집: Scott MacKenzie 2021년 10월 21일
Your variables S1 through S4 are logical vectors. They contain 1s in positions corresponding to the items of interest in column 5. You can use these variables to retrieve the corresponding minimum values in column 6. As an example, for the logical vector S1, the minumum corresponding value in column 6 is
min(T(S1,6))
C.G.
C.G. 2021년 10월 21일
ok i understand that, how would I get the value of column 5 which also equates to this?

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

채택된 답변

Scott MacKenzie
Scott MacKenzie 2021년 10월 21일
편집: Scott MacKenzie 2021년 10월 21일
[m, idx] = min(T(S1,6)); % minimum value in column 6, as per S1
x = T(idx,5); % value in column 5 at same location/row

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by