How to combine 2 graphs from different scripts in another script
显示 更早的评论
Hello everyone, I am trying to combine 2 graphs, ech made in a different script, in another script. I used the code written underneath. However when I run the code it gives an error that it can't find the figures that I made. Can someone tell me what I did wrong and how to make this work? Thanks in advance!
%graph 1
fg1 = figure;
hold on
plot(Q,h);
xlabel('Debiet[m³/s]');
ylabel('Opvoerhoogte [m]');
%graph 2 in another script
fig2 = figure;
hold on;
curve_head_debiet = plot(G_debiet_int,G_head_int);
curve_head_debie2_2 = plot(n_IP*G_debiet_int,G_head_int);
xlim([0 650]);
ylim([0 70]);
xlabel('Debiet [m³/h]');
ylabel('Head [m]');
%combined graph in another script
pompgrafiek = openfig("fg1.fig");
leidingsgrafiek = openfig("fg2.fig");
copyobj(get(gca(leidingsgrafiek),'Children'), gca(pompgrafiek));
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



