How to change Horizontal size of a Constant block based on the "Value" of the block in order to make the value visible
Mostra commenti meno recenti
If block size is small, constant value is not visible, it shows the value as -C-. To avoid this -c-, i need to control the size based on the value programmatically.
Risposte (3)
Anthony Poulin
il 3 Lug 2015
1 voto
I understand what you want to do. And the command line that Abdelmalek and I provide you allows to resize a block. So you just have to create an algorithm which allow to detect if "-C-" is displayed on the block and if it is true, you resize this block with the command line.
1 Commento
THAVAMANI
il 3 Lug 2015
Anthony Poulin
il 3 Lug 2015
0 voti
You have to use the command: set_param(Block,'Position',[50 100 80 130])
But I don't know how to dectect if the value is played on the block or if it is "-C-" which is displayed...
1 Commento
Azzi Abdelmalek
il 3 Lug 2015
If you don't want to change the position of your block. Get it's actual position
pos=get_param('ModelName/Constant','Position');
Then just change the coordinate pos(3) and pos(4)
set_param('ModelName/Constant','Position' ,[pos(1:2) pos(3)+30,pos(4)+60])
1 Commento
THAVAMANI
il 3 Lug 2015
Categorie
Scopri di più su Simulink Functions in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!