Clean up Simulink block diagram

조회 수: 353 (최근 30일)
K E
K E 2012년 2월 23일
Is there an automatic way rearrange a Simulink block diagram so that it is easy to read? For example:
  • Straighten paths where possible
  • Minimize use of white space so map is compact
  • Align blocks along program flow path
For example, clean_up_simulink(myModel) would perform these tasks then save the revised model.
  댓글 수: 1
Ben
Ben 2012년 11월 14일
편집: Ben 2012년 11월 14일
Mathworks should invest the energy to develop an auto-cleanup feature. Tools like these are expected for serious and relevant 21st century software. Yes, it is non-trivial, but take a look at National Instrument's LabView--they've implemented such a feature beautifully and it saves hours of aggravation especially if you are developing complex code.

댓글을 달려면 로그인하십시오.

채택된 답변

Andreas Goser
Andreas Goser 2012년 3월 14일
A year ago, I worked with users and developers ( I called it myself Simulink Beautifier :-) ) to find out if such things are possible. I found myself convinced, that this is a non-trivial undertaking, if you try this in a generic way, as there are too many criteria/rules.
But I know they are customers out there implemented some parts of this. But they all authored own tools. Typically man months of (student) time was invested. I cannot help more specific than saying they created larger MATLAB codes using FIND_SYSTEM, ADD_LINE, SET_PARAM etc.
  댓글 수: 4
Anh Tran
Anh Tran 2020년 1월 31일
From MATLAB R2019b, you can improve your diagram layout and appearance by opening the FORMAT tab on the toolstrip and click on Auto Arrange. This command can realign, resize, and move blocks and straighten signal lines.
In MATLAB R2019a, select Diagram > Arrange > Arrange Automatically.
For more information, see Improve Model Layout.
Amartya Banerjee
Amartya Banerjee 2022년 6월 23일
Rightclick selection>Format> Arrange Automatically [ in 2021b]

댓글을 달려면 로그인하십시오.

추가 답변 (4개)

Anh Tran
Anh Tran 2020년 1월 31일
From MATLAB R2019b, you can improve your diagram layout and appearance by opening the FORMAT tab on the toolstrip and click on Auto Arrange. This command can realign, resize, and move blocks and straighten signal lines.
In MATLAB R2019a, select Diagram > Arrange > Arrange Automatically.
For more information, see Improve Model Layout.
Hope this helps.
  댓글 수: 1
Naga Sai Sameer Sathwick Atyam
Naga Sai Sameer Sathwick Atyam 2023년 1월 19일
how to do in 2016a version as this feature is not available

댓글을 달려면 로그인하십시오.


João
João 2014년 5월 21일
I know that this post is from two years ago, but I want to check if this function as already been implemented.
Thanks,

Joe
Joe 2016년 3월 11일
I completely agree with Ben. LabVIEW has a very nice solution and has had one for years. I always find myself very frustrated working with the Simulink editor. I find it clunky and time consuming. TMW really needs to invest in a utility to automatically clearn up at least a single wire but preferably the entire diagram.
I also find it absolutely annoying that Simulink doesn't follow the standard set by other applications that the scroll wheel pans the diagram instead of zooming. Very annoying.

Monika Jaskolka
Monika Jaskolka 2017년 4월 13일
Doesn't look like anything is built-in for Simulink. In 2017a there is "Stateflow Layout" which automatically improves the layout of charts.
However, there is this tool on the File Exchange that works on Simulink models: https://www.mathworks.com/matlabcentral/fileexchange/51228-auto-layout-tool
  댓글 수: 2
Rashmi Bharadwaja
Rashmi Bharadwaja 2017년 5월 31일
This link can help clean your Simulink models to some extent.
http://blogs.mathworks.com/pick/2014/04/25/clean-up-your-simulink-model/
Praveen Potluri
Praveen Potluri 2017년 8월 1일
You can use the goto block and the from block from the simulink library so that there won't be too many overlapping lines. It is not a automatic way but your block diagram looks clean.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by