How can I connect the maximum points of several
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Xerxes Achaemenid
el 13 de Mzo. de 2021
Comentada: Xerxes Achaemenid
el 13 de Mzo. de 2021
Hello friends, I want to connect the maximum points of several graphs with a curved line in one figure. I can calculate the coordinates of maximum points then connect them with a line, But I want a code that Matlab itself recognizes the maximum points and connects them. Thanks for your attention
2 comentarios
Respuesta aceptada
darova
el 13 de Mzo. de 2021
THe short version
clear
clc
t=263:1:383;
rr = 1:5;
for r = [ rr/1000 rr/100 rr/10 rr ]
[T, R]=meshgrid(t,r);
k1=exp(17.34-(48900./(8.314*T)));
k2=exp(42.02-(124200./(8.314*T)));
XA=(k1-R)./(k1+k2);
[XA_max, index] = max(XA);
T_max = T(index);
plot(T, XA, T_max, XA_max, 'ro')
axis([263,383,0,1])
grid on
hold on
end
hold off
3 comentarios
darova
el 13 de Mzo. de 2021
Another interpretation
clear
clc
cla
t = linspace(263,383,30);
rr = 1:5;
r = [ rr/1000 rr/100 rr/10 rr ];
[T, R]=meshgrid(t,r);
k1=exp(17.34-(48900./(8.314*T)));
k2=exp(42.02-(124200./(8.314*T)));
XA=(k1-R)./(k1+k2);
[~, index] = max(XA,[],2);
ind = sub2ind(size(XA),1:size(XA,1),index(:)');
plot(T(ind), XA(ind), 'r-o')
line(T',XA')
text(T(ind), XA(ind),num2str(XA(ind)'))
ylim([0 1])
Más respuestas (0)
Ver también
Categorías
Más información sobre Entering Commands en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!