How to extract high-quality image from MATLAB for my research article?

2 visualizaciones (últimos 30 días)
I have the following code and I want to plot x1 vs t, x2 vs t and x3 vs t in my article. How can I have a very high resolution image. What commands/code should i use for that?
clc
clear all
close all
x1(1) = 1.5;
x2(1) = -0.15;
x3(1) = 0.1;
a = 1.2;
b = 2.92;
c = 6;
t_span = 100;
dt = 0.01;
t = 0:dt:t_span;
for n = 1:length(t)
x1(n+1) = x1(n) + dt * (x2(n));
x2(n+1) = x2(n) + dt * (x3(n));
x3(n+1) = x3(n) + dt * (-c*x1(n) - b*x2(n) - a*x3(n) + x1(n)*x1(n));
end
  2 comentarios
Walter Roberson
Walter Roberson el 5 de Abr. de 2025
Your x1, x2, x3 are one element longer than your t
Walter Roberson
Walter Roberson el 5 de Abr. de 2025
clc
clear all
close all
x1(1) = 1.5;
x2(1) = -0.15;
x3(1) = 0.1;
a = 1.2;
b = 2.92;
c = 6;
t_span = 100;
dt = 0.01;
t = 0:dt:t_span;
for n = 1:length(t)-1
x1(n+1) = x1(n) + dt * (x2(n));
x2(n+1) = x2(n) + dt * (x3(n));
x3(n+1) = x3(n) + dt * (-c*x1(n) - b*x2(n) - a*x3(n) + x1(n)*x1(n));
end
plot(t, x1, t, x2, t, x3)
legend({'x1', 'x2', 'x3'})

Iniciar sesión para comentar.

Respuestas (2)

Sam Chak
Sam Chak el 5 de Abr. de 2025
Is 600 dpi good enough?
plot(t, x1, t, x2, t, x3)
ax = gca;
exportgraphics(ax, 'myPlot.png', 'Resolution', 600)
Else if you want to use the default width and match the on-screen size more closely, then try this:
sppi = get(groot, "ScreenPixelsPerInch");
exportgraphics(ax, "myPlot.png", "Resolution", sppi)

Thorsten
Thorsten el 7 de Abr. de 2025
Print to a vector format like eps or pdf and you have an arbitrary fine resolution.

Categorías

Más información sobre Migrate GUIDE Apps 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!

Translated by