필터 지우기
필터 지우기

Is there a way to combine plots generated in simbiology model analyzer into a single figure to export?

조회 수: 2 (최근 30일)
I am using the Local Sensitivity on simbiology to generate results, and I'd like to have a single figure with the subplots generate by the Calculate Sensitivities program (which generates one page with time courses and another with a heat map chart). Is it possible? Or do I have to export the data and run it programatically?

채택된 답변

Jeremy Huard
Jeremy Huard 2023년 9월 25일
starting R2023b you can do it programmatically after exporting the figures with:
f1 = figure(1); % change figure numbers here
f2 = figure(2);
tl = tiledlayout(figure,1,2);
tl_plot1 = f1.Children;
tl_plot2 = f2.Children;
tl_plot1.Parent = tl;
tl_plot2.Parent = tl;
tl_plot2.Layout.Tile = 2;
close(f1);
close(f2);
This could also be done in earlier releases but it would require some more code because earlier releases were using the now discouraged subplot instead of the new tiledlayout.
Best regards,
Jérémy
  댓글 수: 1
Rebeca Hannah Oliveira
Rebeca Hannah Oliveira 2023년 9월 25일
Thanks! I also found out how to do it in v2023a. In case someone needs it, here it is:
% Step 1: export figure from Simbiology Model Analyzer and save it (.fig)
% Step 2: open figures
figure(1) = openfig('figureName.fig');
figure(2) = openfig('figure2Name.fig');
% Step 3:
ax1Chil = figure(1).Children;
ax2Chil = figure(2).Children;
% Step 4: open new figure to copy the other 2 to it
f2 = figure(3);
ax1 = copyobj(ax1Chil,f2);
ax2 = copyobj(ax2Chil,f2);

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2023년 9월 25일
I don't think you have to export differently
% First subplot for time courses
subplot(2, 1, 1);
% Plot time courses using data from Calculate Sensitivities
%#
% Second subplot for heat map chart
subplot(2, 1, 2);
% Plot heat map chart using data from Calculate Sensitivities
  댓글 수: 1
Rebeca Hannah Oliveira
Rebeca Hannah Oliveira 2023년 9월 25일
Thanks. Actually, I'm using the model analyzer to generate the figures. My question is, once I export them from the model analyzer, is it possible to join the figures in the same window?

댓글을 달려면 로그인하십시오.

커뮤니티

더 많은 답변 보기:  SimBiology Community

카테고리

Help CenterFile Exchange에서 Extend Modeling Environment에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by