Here i have a 1X6 matrix
y =
682.8333 399.8160 34.2270 46.1800 107.7035 21.5367
what i wanna do is to find the FIRST minimum element
which means if i plot "y" i wanna find first minimum turning point
for this example it must be 34.2270
Thank you.

답변 (2개)

Adam
Adam 2015년 3월 2일

1 개 추천

pks = findpeaks( -y );
will work if you have the Signal Processing Toolbox.
If you don't you can find peak finding algorithms on the File Exchange that will do a similar job.
Andrei Bobrov
Andrei Bobrov 2015년 3월 2일

1 개 추천

y = [682.8333 399.8160 34.2270 46.1800 107.7035 21.5367];
out = y(find(diff(y)>0,1,'first'));

댓글 수: 2

Wow thank u so very much...
It worked :)
This only works if it is a decreasing function for the first values of y...

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

카테고리

제품

질문:

2015년 3월 2일

댓글:

2019년 6월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by