MATLAB Answers

Remove dashed lines from Simulink diagram

39 ビュー (過去 30 日間)
Pavel 2016 年 11 月 7 日
コメント済み: Robert 2016 年 11 月 8 日
Sometimes, after editing a simulink diagram many red dashed lines remain on diagram. Is it possible to remove all them at once ? Thanks.

  0 件のコメント


回答 (1 件)

Robert 2016 年 11 月 7 日
delete_line(find_system(your_model, 'FindAll', 'on', 'Type', 'line', 'Connected', 'off'))

  2 件のコメント

Pavel 2016 年 11 月 7 日
Thanks. Does exist a shortcut for this command somewhere in Simulink options, e.g. "Refresh Diagram" or something like this ?
Robert 2016 年 11 月 8 日
Not that I am aware. This code will find and delete all unconnected lines, which is something that should be done carefully. If you want to make it easy to do repeatedly, you could consider making it the ClickFcn of an annotation on your diagram.



Community Treasure Hunt

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

Start Hunting!

Translated by