필터 지우기
필터 지우기

Finding the indexes of multiple elements that are equal to a certain value in an array

조회 수: 17 (최근 30일)
W=400;Lb=5;Lc=3;
% a)
D = (1:0.01:2.9);
T = Lb*Lc*W./(D.*sqrt(Lc^2-D.^2));
[t,d]=min(T);
Specifically, I need help finding the D values where T increases 10 percent above its minimum value. My initial approach was to try and find the indexes of the elements in D that are equal to 1466.67, which is 10 percent above the function's minimum value, then plug them into D to find out what values those indexes correspond to. I've searching on here, and have tried using the find() command and the ismembertol() command, to no avail. I am probably using them wrong anyways, and would greatly appreciate any help in solving my problem.

채택된 답변

Walter Roberson
Walter Roberson 2018년 9월 25일
D(find(T>=t*1.1,1))
  댓글 수: 3
Christopher Abel
Christopher Abel 2018년 9월 25일
편집: Christopher Abel 2018년 9월 25일
The data begins above the threshold, dips beneath it for a bit, then comes back above the threshold and ends above it.
Christopher Abel
Christopher Abel 2018년 9월 25일
Also, thank you very much for your help. A little bit of tweaking with the code you suggested, and I can now use it to get a decent answer. Thanks!

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

추가 답변 (2개)

Christopher Abel
Christopher Abel 2018년 9월 25일
This just returns "1"
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 9월 25일
You will not find any place where they are exactly equal. Do you need to find all that are above the threshold, or all below, or do you need to find the transition boundaries?

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


Christopher Abel
Christopher Abel 2018년 9월 25일
The transition boundaries, I think. Which is why that ismembertol() looked promising, but I don't think I used it right.

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by