Publishing from livescript doesn't show graphs

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?

Respuestas (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 20 de Mayo de 2021

0 votos

1st, execute your code
2nd publish. It will work as it should.
Good luck.

Categorías

Más información sobre MATLAB Report Generator en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Preguntada:

el 16 de Mayo de 2021

Respondida:

el 20 de Mayo de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by