Change component size in system composer
Mostrar comentarios más antiguos
How can I change a component size in MATLAB system composer by means of APIs (command line or MATLAB code) ?
Respuesta aceptada
Más respuestas (1)
Luca Ferro
el 6 de Mzo. de 2023
Editada: Luca Ferro
el 6 de Mzo. de 2023
1 voto
via script:
scTmpArc=open_system('scTmpArc') %sxTmpArc is the name of your system composer file
set_param('scTmpArc/.../..',position',[100 400 500 500]) %the first paramter is the fullpath to your block
The numbers are the dimensions in pixel [x0 y0 x1 y1] meaning that x1-x0 is the lenght, y1-y0 is the height
if you don't know the fullpath you can search for it by doing:
cmpNames=getfullname(Simulink.findBlocks('scTmpArc')) %this will list every component path in cell arrays
you can then parse the cell array to find the name you need (also via script or by hand)
Note: keep in mind that system composer is just a simulink interface from a scripting point of view. Basically all the simulink commands work for both.
Categorías
Más información sobre System Composer en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!