フィルターのクリア

Is there a way to filter annotations by length in the Report Generator?

1 回表示 (過去 30 日間)
Jake Guttenplan
Jake Guttenplan 2017 年 7 月 21 日
回答済み: Eric 2017 年 12 月 14 日
In a simulink model that uses areas for visual aids, each area is numbered. However each of these numbered areas results in a new entry. In reality we would like to skip annotations that are only 1-4 characters in length when using the annotation loop. Is there a way to make a custom component that is capable of doing this?

回答 (1 件)

Eric
Eric 2017 年 12 月 14 日
A little late, hopefully this will help.
You need to use the IF component to filter out unwanted annotations object. Unfortunately, there is no public API to get the current reported annotation handle. To get the current reported annotation handle try the following:
  1. Download the attached ZIP file
  2. Copy getReportedAnnotation.m to matlabroot/toolbox/rptgenext/rptgenext/@RptgenSL/getReportedAnnotation.m
  3. Run the following to update MATLAB toolbox cache
>> rehash toolboxcache
Now in your IF component, use the following expression to keep only annotations that are longer than 4 characters.
numel(get(RptgenSL.getReportedAnnotation, 'Name')) > 4
For a working example, see annotation_ex.rpt within the ZIP file.

カテゴリ

Help Center および File ExchangeReporting and Database Access についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by