フィルターのクリア

Include Simulink model Image when publishing an mfile

5 ビュー (過去 30 日間)
Lazaros Moysis
Lazaros Moysis 2014 年 4 月 26 日
コメント済み: Neil Foxman 2018 年 11 月 13 日
I Have an mfile where i read data from a simulink model and i plot them. I want to publish the results in html, but i also want the simulink model to be displayed (as an image), not just the plots. How should i do it? The mfile is as follows:
%% The results of the simulation of the above model
plot(x,y)
figure;plot(x,z)
figure;plot(y,z)
I can of course take a snapshot and use a command to display it, but I want a more elegant way.

採用された回答

Philipp Maier
Philipp Maier 2014 年 6 月 12 日
The MATLAB print command provides the option for printing Simulink models. For an overview of how to do this in Simulink, refer to Print and Export Models.
Since you are planning to do this from a script, take a look at print from the MATLAB Command Line.
  2 件のコメント
Philipp Maier
Philipp Maier 2014 年 6 月 12 日
If you are looking for a more professional HTML view of your Simulink, I recommend looking at the WebView functionality of the Simulink Report Generator .
Lazaros Moysis
Lazaros Moysis 2014 年 6 月 12 日
Thanks a lot for all these useful information!

サインインしてコメントする。

その他の回答 (1 件)

Sean de Wolski
Sean de Wolski 2014 年 6 月 12 日
You can use open_system to open the system. Then publish will handle it automagically:
open_system('vdp')
  2 件のコメント
Lazaros Moysis
Lazaros Moysis 2014 年 6 月 13 日
Thanks!
Neil Foxman
Neil Foxman 2018 年 11 月 13 日
I was still having trouble with this and I learned that you need to first close the Simulink model before you can publish it.
Then open_system() should work fine.
The answer was buried in one of ihavenoclue's comments here: https://stackoverflow.com/questions/26549147/matlab-publish-image-pdf/53288890#53288890

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by