How do I rotate a text written inside a block mask?
9 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2020-4-24
回答: MathWorks Support Team
2020-4-24
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?
采纳的回答
MathWorks Support Team
2020-4-24
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.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!