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 Center および File ExchangeMATLAB Report Generator についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by