How to find the max value of a curve on a graph

8 ビュー (過去 30 日間)
Will Jeter
Will Jeter 2020 年 11 月 12 日
回答済み: KSSV 2020 年 11 月 12 日
I'm trying to find the max value of my G(T) curve(the parabolic one). Not sure how to het the value and make it show up as a marker on the graph
T = [310:1:450];
v = 1;
V = 10;
dHrxn = -80000;
UA = 3600;
kf0 = 1;
kc0 = 100;
T0 = 400;
ER = 20000;
CpA = 40;
kf = exp(-20000*(1./T-1/400));
kc = 100*exp((80000/1.987)*(1./T-1/400));
x = 1./(v./(V.*kf)+1+(1./kc));
R = 400*(T-310);
R1 = 400*(T-256);
R2 = 400*(T-233.5);
R3 = 400*(T-218.2);
R4 = 400*(T-391);
R5 = 400*(T-328);
R6 = 400*(T-346);
R7 = 400*(T-353.2);
G = x*-dHrxn;
figure
hold all
plot(T,R,T,G,T,R1,T,R2,T,R3,T,R4,T,R5,T,R6,T,R7)
legend('R(T)','G(T)','Ta=250K','Ta=225K','Ta=208K','Ta=400K','Ta=330K','Ta=350K','Ta=358K','Location','NorthWest')
axis([310 450 0 10*10^4])
xlabel('Temperature (K)')
ylabel('G(T) and R(T) (cal/mol)')
title('G(T) and R(T) vs. T')

回答 (1 件)

KSSV
KSSV 2020 年 11 月 12 日
If (x,y) are the data points.
[val,idx] = max(y) ;
plot(x,y)
hold on
plot(x(idx),y(idx),'*r')

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by