MATLAB Answers

Hesam
0

How to reorganize blocks programmatically based on another block.

Asked by Hesam
on 4 Jul 2018
Latest activity Edited by TAB
on 6 Jul 2018
Hi, I am trying to organize a model programmatically. Basically I want to reposition all the Inports/outports of a subsystem with respect to the inputs and outputs of a subsystem block. Here is an example of what I am trying to accomplish. Does anyone now of a simple way to do so?
Thank you very much in advance

  0 Comments

Sign in to comment.

Products


Release

R2016a

2 Answers

Answer by Mark McBroom on 5 Jul 2018

You will need to write MATLAB code that uses find_system() to locate the subsystem, inports and outports, and then get_param(gcbh,'Position')/set_param(gcbh,'Position', ...) to obtain and change their location on the canvas.

  0 Comments

Sign in to comment.


Answer by TAB
on 6 Jul 2018
Edited by TAB
on 6 Jul 2018

Check this submission on file exchange:
You can modify it to suite your need.

  0 Comments

Sign in to comment.