Publishing from livescript doesn't show graphs
16 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Sulaymon Eshkabilov
2021-5-20
1st, execute your code
2nd publish. It will work as it should.
Good luck.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!