Hey Matlab community, I have another one for you all. I have a vector of values BAC_F that corresponds with time, and I want the first position of BAC(BAC_F<.08) , but I can't quite figure it out. Any help and suggestions are appreciated.

 채택된 답변

Star Strider
Star Strider 2014년 8월 5일

0 개 추천

If you want the index of the first value where BAC < 0.08:
BACx = find(BAC < 0.08, 1, 'first')

댓글 수: 2

Adam Palmer
Adam Palmer 2014년 8월 5일
Thats just what I was going for, Thanks again Star Strider!!
Again, my pleasure!

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

추가 답변 (1개)

Ben11
Ben11 2014년 8월 5일
편집: Ben11 2014년 8월 5일

0 개 추천

YourVector = BAC(BAC_F<0.8)
Then
FirstValue = YourVector(1)
Is that what you meant?
If not it might simply be
YourVector = BAC_F < 0.8
Do you want to sort the array? Then you can use
sort(YourVector)
and then get the first element.

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

질문:

2014년 8월 5일

댓글:

2014년 8월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by