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

2 ビュー (過去 30 日間)
Pallov Anand
Pallov Anand 2025 年 4 月 5 日
回答済み: Thorsten 2025 年 4 月 7 日
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 件のコメント
Walter Roberson
Walter Roberson 2025 年 4 月 5 日
Your x1, x2, x3 are one element longer than your t
Walter Roberson
Walter Roberson 2025 年 4 月 5 日
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'})

サインインしてコメントする。

回答 (2 件)

Sam Chak
Sam Chak 2025 年 4 月 5 日
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 2025 年 4 月 7 日
Print to a vector format like eps or pdf and you have an arbitrary fine resolution.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by