Is it possible to plot data from multiple scripts on to a single figure?
5 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I'm a relatively new MATLAB user. I was wondering if it was possible to plot data from three scripts on to a single figure. It's for a numerical methods problem, where the same problem with the same domain is being solved using 3 different numerical schemes. I've written three different scripts and each produces a plot. I was wondering if I could display all 3 on a single graph.
0 个评论
回答(1 个)
Atsushi Ueno
2022-10-23
编辑:Atsushi Ueno
2022-10-23
% script file 1
x = 1:0.01:pi*2;
plot(x, sin(x));
savefig('myfig.fig'); % save current figure into a .fig file
% script file 2
openfig('myfig.fig'); % load the .fig file
hold on
x = 1:0.01:pi*2;
plot(x, cos(x));
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!