plotting percentage of a max value
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have 15 different graphs. For each one I have found the max value. I want to plot a dot on the curve at 5% of the max value. Could someone help please?

2 件のコメント
Ameer Hamza
2020 年 12 月 2 日
What do you mean by "5% of the max value". The circle in your image is right at peak.
回答 (1 件)
KSSV
2020 年 12 月 2 日
編集済み: KSSV
2020 年 12 月 2 日
You may get multiple values for this case.
[val,idx] = max(y) ;
y1 = val*5/100 ;
% Increase the reoslution of (x,y) data
xi = linspace(min(x),max(x),1000) ; % change the number of needed
yi = interp1(x,y,xi) ;
% Get the index of y1
idx = abs(yi-y1)<=10^-3 ; % change the tolerance if needed
iwant = [xi(idx) yi(idx)] ;
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!