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

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

 采纳的回答

MathWorks Support Team
MathWorks Support Team 2026-4-10,0:00
slreportgen.utils.hasUniqueModelNotesslreportgen.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);

更多回答(0 个)

类别

产品

版本

R2025a

Community Treasure Hunt

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

Start Hunting!