"Simulink Notes"(モデル​のメモ)が定義されて​いるモデルの階層のみ​をレポートする方法は​?

Simulink Report Generatorを使って、"Simulink Notes" が定義されているモデルやサブシステム階層のみを含むレポートを作成したいです。どうすればよいですか? 

 Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 17 Avr 2026 à 0:00
Modifié(e) : MathWorks Support Team le 17 Avr 2026 à 12:06

0 votes

"slreportgen.utils.hasUniqueModelNotes" と"slreportgen.report.Notes"クラスを組み合わせることで実現できます。
以下のサンプルコードを参考にしてください。
import mlreportgen.report.*
import mlreportgen.dom.*
import slreportgen.report.*
import slreportgen.finder.*
import slreportgen.utils.*
model = "myModel";
load_system(model);
rpt = slreportgen.report.Report(model + "_NotesWithSnapshot", "pdf");
open(rpt);
ch = Chapter("Title", "Notes with Diagram Snapshot");
finder = DiagramFinder(model);
while hasNext(finder)
system = next(finder);
if hasUniqueModelNotes(system)
sec = Section("Title", system.Path);
diag = Diagram(system);
diag.Snapshot.Caption = "Diagram: " + system.Path;
add(sec, diag);
add(sec, Notes(system));
add(ch, sec);
end
end
add(rpt, ch);
close(rpt);
rptview(rpt);

Plus de réponses (0)

Produits

Version

R2025a

Community Treasure Hunt

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

Start Hunting!