How do I rotate a text written inside a block mask?

9 views (last 30 days)
I am generating a block mask and I would like the texts to be placed according to the block orientation (rotation). Can I rotate a text written inside the mask using the "text" function or using another function?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 24 Apr 2020
To flip a text inside a mask, you can display a text using the 'disp' command and flip it with the 'fliplr' function.
Alternatively, if you would like to rotate the text, you can set the "Icon rotation" option to "Rotates" in the Mask Editor and then the text is rotated by 90 degrees when the block is rotated. At the same time, when using the function 'text' to display a text, the location of the string will be flipped when the block is flipped.
However, these workarounds do not allow to rotate the text upside down. In MATLAB, it is possible to rotate a text specifying the degrees using the function 'text' and the property 'Rotation', but this functionality is not available inside a mask.
You can find an example attached on how to detect if the orientation has changed and display a text in a mask. You can try rotating and flipping the block to see how the texts are moved and rotated.

More Answers (0)

Categories

Find more on Interactive Model Editing in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!