Add picture to annotation of the model

4 ビュー (過去 30 日間)
Georgii
Georgii 2023 年 2 月 21 日
回答済み: Sameer 2024 年 9 月 10 日
Hello,
How can i add not only the text, but also the pictures from annotation to my simulink model into pdf report?

回答 (1 件)

Sameer
Sameer 2024 年 9 月 10 日
Hi Georgii
To generate a PDF report that includes both text and images from annotations in your Simulink model using a MATLAB script, you can use the "AnnotationFinder" class to locate all annotations within your model. Iterate through annotations using a loop and append to the "report" object.
Here's how you can do it:
% Open Your Model
model = 'your_model_name';
open_system(model);
% Import Required Packages
import mlreportgen.report.*;
import slreportgen.report.*;
import slreportgen.finder.*;
% Create a Report Object
rpt = slreportgen.report.Report('MySimulinkReport', 'pdf');
% Find Annotations
finder = slreportgen.finder.AnnotationFinder(model);
while hasNext(finder)
annotation = next(finder);
append(rpt, annotation);
end
% Generate the Report
close(rpt);
rptview(rpt);
For more detailed instructions, you can refer to the below MathWorks documentation:
Hope this helps!

カテゴリ

Help Center および File ExchangeSimulink Report Generator についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by