How to optimize memory usage for EmbeddedWebView document using high quantities of Simulink models?
1 view (last 30 days)
Show older comments
I have a few hundreds to thousands of Simulink models that I need to include in a single Embedded Web View document using the MATLAB Report Generator. To be included, all models need to be loaded in memory. Is there a way to get the same result without having all the models loaded at once?
This is the generation format I am currently using:
models = {'model1', 'model2'}; % Test Simulink models (final version will have 500+ models)
load_system(models); % What I am trying to change
rptgen = TestGeneration('testGen', models); % Create the document
fillslwebview(rptgen); % Display only the models
% Clean up
close(rptgen);
close_system(models);
rptview('testGen'); % View report
With the class TestGeneration:
classdef TestGeneration < slreportgen.webview.EmbeddedWebViewDocument
%SystemDesignVariables Report on variables used by a Simulink model
% Defines a class of report generators to produce HTML reports on
% the workspace and data dictionary variables used by a Simulink
% model. The generated report includes this information for
% each variable:
%
% Value (if the value is a scalar, numeric value)
% Data Type
% Source (e.g, path of dictionary containing the variable)
% Source Type (e.g., data dictionary or base workspace)
% Users (path of blocks that use the variable)
methods
function rpt = TestGeneration(reportPath, modelNames)
% Invoke the EmbeddedWebViewDocument constructor, which
% saves the report path and model names for use by the
% report's fill methods.
rpt@slreportgen.webview.EmbeddedWebViewDocument(reportPath,...
modelNames);
% Turn off duplicate link warnings to avoid warnings for
% blocks that use multiple design variables.
rpt.ValidateLinksAndAnchors = false;
rpt.ExportOptions.IncludeMaskedSubsystems = true;
rpt.ExportOptions.IncludeSimulinkLibraryLinks = true;
rpt.ExportOptions.IncludeReferencedModels = true;
end
function fillContent(rpt)
% Currently empty, displaying models with the fillslwebview function
end
end
end
Class comments are from this documentation page: https://www.mathworks.com/help/rptgenext/ug/embedded-web-view-report-for-model-variables.html
0 Comments
Answers (0)
See Also
Categories
Find more on Manual Performance Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!