Why am I unable to delete an annotation using an empty string in SIMULINK 6.3 (R14SP3)?

2 次查看(过去 30 天)
When I try to delete annotations by first getting the handle of the annotation and then setting the "Text" to the empty string by referring to the documentation Section 'Creating Annotations Programmatically',
h = find_system('test', 'FindAll', 'on', 'Type', 'annotation');
set_param(h, 'Name', '');
I receive the following warning and the annotation is not deleted, although the documentation still advocates this method:
Warning: You cannot set an annotation name to an empty string.

采纳的回答

MathWorks Support Team
In releases before Simulink 6.5, there is an error in the documentation for deleting annotations under 'Creating Annotations Programmatically'. The documentation should read as follows:
To delete an annotation, use the find_system command to get the annotation's handle and then use DELETE function for e.g.,
delete(find_system(gcs, 'FindAll', 'on', 'type', 'annotation'));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by