How to plot A Curve That Connects The Highest Values in Y-Axis

1 回表示 (過去 30 日間)
Yaser Khojah
Yaser Khojah 2019 年 4 月 26 日
編集済み: Yaser Khojah 2019 年 4 月 29 日
Can anyone please help me to create the curve as below. I'm looking for away to plot the highest point at y-axix for all x-axis. I attached my data and plot as below.
scatter(MaT_All(:,18), MaT_All(:,17))
Capture.JPG
  2 件のコメント
darova
darova 2019 年 4 月 26 日
What about boundary?
Yaser Khojah
Yaser Khojah 2019 年 4 月 26 日
編集済み: Yaser Khojah 2019 年 4 月 26 日
Dear darova,
I want to focus on the top part only and I need to extract these data to do more analyse.

サインインしてコメントする。

採用された回答

Naman Bhaia
Naman Bhaia 2019 年 4 月 29 日
Hello Yaser,
I believe the issue you are facing can be solved in two steps:
  1. Find the maximum value corresponding to each value of x. For this, you can visit this MATLAB Answer thread and see if it helps.
  2. Plot the values found in the previous step to form the upper boundary .
  1 件のコメント
Yaser Khojah
Yaser Khojah 2019 年 4 月 29 日
編集済み: Yaser Khojah 2019 年 4 月 29 日
Dear Naman, I have looked into it but I have one question as my code below. How to find the index of the ymax?
x = round(MaT_All(:,18),0);
y = MaT_All(:,17);
[uv,~,idx] = unique(x);
ymax = accumarray(idx,y,[],@max); %build matrix
figure
scatter(uv,ymax)
line(uv,ymax)
I alost tired the following and I still need to find the index of (Resutl)
Result = splitapply(@max, y, idx);
figure
scatter(uv,Result)
line(uv,Result)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by