現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
How to interpolate the local peak elevation to obtain the profile ?
2 ビュー (過去 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!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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 (한국어)