이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
How to interpolate the local peak elevation to obtain the profile ?
조회 수: 6 (최근 30일)
이전 댓글 표시
Excuse me everyone. I have the peak point location in the figure attachement. I want to interpolate each peak point to get the profile as in the red color in the figure. How can I solve this problem ? Thank you very much.
답변 (1개)
Star Strider
2022년 6월 16일
One option is the envelope function. Choose the 'peak' option and an appropriate value for the window length.
댓글 수: 14
Lyhour Chhay
2022년 6월 16일
Dear sir,
Thank you very much for response. I appreciate your answer very much. The envelop function seem like work fine or the solution. However, I am still doubt about '[yupper,ylower] = envelope(x,np,'peak')'
The 'np' value is highly affected to the curve. I don't know how should I choose the value of np. In the figure below, I randomly the np value 10000 and it show the result like that. Actually, I want the curve in the red color. How to solve this problem sir ?
Best Regards,
Star Strider
2022년 6월 16일
I doubt that the envelope funciton can do any better than that with other ‘np’ values.
One option I can think of to get that result is to use findpeaks with 'MinPeakHeight' and 'MinPeakDistance' and then just connect the results (using the ‘locs’ output to index into the data).
You will have to experiment.
Lyhour Chhay
2022년 6월 16일
Dear Sir,
Thank you very much for your suggestion. I still doubt about your first suggestion. After I get the 'locs' from 'findpekas' fuction, How to connect the output into data ? do you mean put the locs into 'np' value ? for the 'np' value it can be only scalar.
Best regards,
LYHOUR
Star Strider
2022년 6월 16일
Use the ‘locs’ output to index into the appropriate vectors:
xpoints = x(locs);
ypoints = y(locs);
.
Lyhour Chhay
2022년 6월 16일
Dear sir,
here is my code:
AvgLevel = mean(z);
[peak,loc]=findpeaks(Zp,Xp,'MinPeakHeight',AvgLevel,'MinPeakDistance',0.005);
[yupper,ylower] = envelope(Zp,10000,'peak')'
when I put xpoints = x(locs);, it say 'Array indices must be positive integers or logical values'
Star Strider
2022년 6월 16일
That is because there is no ‘locs’ variable! (I was referring to the findpeaks documentation convention for the output names.)
Use ‘loc’ instead, since that’s what you named it.
Lyhour Chhay
2022년 6월 16일
Dear Sir,
Yes I understand, I changed already. However, It still error as show in the figure below.
I still not clear. After I get the xpoints, I have to put it into 'envelope(Zp,xpoints,'peak')' something like that ?
Star Strider
2022년 6월 16일
O.K. I did not initially see that you were using ‘Xp’ in your findpeaks call. If you want to use ‘loc’ as an index, remove that reference. The ‘loc’ output will then be in terms of the indices.
Star Strider
2022년 6월 16일
That depends on what you want to do.
I would just connect the ‘xpoints’ and ‘ypoints’ values with a line and enjoy the result.
Lyhour Chhay
2022년 6월 16일
oh I got it. Thank you very much sir for your valuable time.
Anyway, sir, I am sorry for your inconvenience. I have one more question.I have been post in the forum:
I really appreciate and thank you very much it if you could guide me to solve the problem.
Best Regards,
LYHOUR
Star Strider
2022년 6월 16일
My pleasure!
No inconvenience at all!
I saw that post, however I have no idea how to help you with it.
Lyhour Chhay
2022년 6월 16일
I really appreciated your kindness sir. Actually, I found some forum that is similar to my problem as the following link:
I also commented my problem in that post. However, I am not clearly understand the proposed algorithm. I hope that I can solve this problem.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)