How to optimize memory usage for EmbeddedWebView document using high quantities of Simulink models?

2 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Manual Performance Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by