plot several equation and extract vertices
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
How can I plot in the same graph this 4 linear equations ?
y = 1
y = -4x + 1
x=4
2x+5y = 23
It's possible to extract algebraically vertexes of the quadrilateral picture?
Risposta accettata
Image Analyst
il 4 Ago 2024
% First y=1
yline(1, 'Color', 'r', 'LineWidth', 2)
hold on;
% Next y = -4x + 1 over the x range of -5 to 5.
x = linspace(-5, 15, 1000);
y = -4 * x + 1;
plot(x, y, 'b-', 'LineWidth', 2);
grid on;
% Next x = 4
xline(4, 'Color', 'm', 'LineWidth', 2)
% Next 2*x + 5*y = 23
% or y = (23 - 2 * x) / 5
x = linspace(-5, 15, 1000);
y = (23 - 2 * x) / 5;
plot(x, y, 'g-', 'LineWidth', 2);
legendStrings = {'y = 1','y = -4x + 1','x=4','2x+5y = 23'};
legend(legendStrings, 'Location', 'southwest');
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Line Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!