필터 지우기
필터 지우기

Why won't this equality work?

조회 수: 1 (최근 30일)
Andrew Mosqueda
Andrew Mosqueda 2022년 10월 10일
답변: David Hill 2022년 10월 10일
I got my top 17 values and I need to obtain a set corresponding values with it. I tried to use a code I used beforehand but it was comparing a single value, not a matrix where I think my problem resides. When ran it goes through obtainining none of the secondary values (Ts).
wh17=maxk(w(:,3),17);
Hs=mean(wh17);
for i=1:50
if w(i,3)==wh17(:)
Ts=w(i,2)
end
end

채택된 답변

David Hill
David Hill 2022년 10월 10일
wh17=maxk(w(:,3),17);
Hs=mean(wh17);
Ts=w(ismember(w(:,3),wh17),2);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by