Publishing from livescript doesn't show graphs

조회 수: 15 (최근 30일)
Mat Labtask
Mat Labtask 2021년 5월 16일
답변: Sulaymon Eshkabilov 2021년 5월 20일
Hello! I am trying to publish a simple script (.m extension, let it be MyScript.m) with some graphs. When I have this script opened in matlab and I try to publish it via default matlab publish tool (special section "publish" at the top of the matlab window), it works well. I mean, during the publishing, matlab generates and opens a new window for each figure, and the document (I publish it to html) contains all the graphs.
But I need to generate some dozens of these reports, and I would like to do it in a loop via livescript, using publish(MyScript.m) function. But it doesn't work. When I run publish(MyScript.m), I have only a html file without the graphs.
How does it work? What is the problem?
I tried it with different settings, but it still doesn't work. As an example, here is a code.
%% Test Code
% descrtiption
%% Intro
% bla bla bla
x=linspace(-2, 2, 1000);
figure();
plot(x,sin(x));
figure();
plot(x,cos(x));
figure();
plot(x,x.^2);
I tried snapnow after each plot, but the result is the same.
I cannot understand, what is the problem. Can you help me, please?

답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 5월 20일
1st, execute your code
2nd publish. It will work as it should.
Good luck.

카테고리

Help CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by