Unable to generate webview when -nodisplay option specified

4 次查看(过去 30 天)
I am trying to generate a WebView in an environment where MATLAB is running without a display, i.e. launching MATLAB via:
matlab -nodisplay -nosplash -nodesktop create_webview
Where create_webview is just a wrapper around slwebview with my project's settings configured:
outfname = slwebview(systemp,'LookUnderMasks','all','FollowLinks','on',...
'FollowModelReference','on',... %Required for model reference
'SearchScope','All',... %Required to follow links within model reference
'ViewFile', false, 'ShowProgressBar', false);
The output of the script is:
Create the webview
Starting slwebview generation...
Error using slreportgen.webview.ui.Exporter/export
Simulink Web View is not supported in -nodisplay mode
Why must I have a display configured/enabled to generate the WebView? In Continuous Integration (CI) environments especially, it not possible to have a display configured.

回答(1 个)

Karan Singh
Karan Singh 2023-10-4
Hi Adam,
From what I understand, the goal is to understand why a display is required to generate the web view and why this limitation exists, particularly in CI environments where having a display is not feasible.
This is because the Simulink Web View relies on graphical capabilities to generate and display the web view of the Simulink model. In “-nodisplay” mode, MATLAB does not have access to a display system, which is required for generating the web view. This limitation is not specific to Continuous Integration (CI) environments but is inherent to MATLAB's design.
If you need to generate a web view without a display, you can consider alternative approaches. For example, you could generate a report or documentation using MATLAB's Report Generator tools (such as MATLAB Report Generator or MATLAB Publishing) and include relevant information about your Simulink model.
Attached below are some documentation links that you may find helpful:
Hope this helps!
Karan Singh Khati
  2 个评论
Adam Austin
Adam Austin 2023-10-4
Creating model web views also requires having an active display. It seems that almost any interaction that involves Simulink requires a display of some sort.
Our team was able to build a container with a virtual frame buffer (xvfb) running in the background to provide the necessary display support to Simulink.
Nihar Gandhi
Nihar Gandhi 2023-10-4
I've also had success creating a fake $DISPLAY using a vncserver on linux, which allows simulink to generate webviews.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Create Model Web Views 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by