Why doesn't the position use the specified units in MATLAB R2014b?
1 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2014-10-7
回答: MathWorks Support Team
2014-10-7
Why doesn't the position use the specified units in MATLAB R2014b?
采纳的回答
MathWorks Support Team
2014-10-7
Starting in MATLAB R2014b, the order in which you specify position and units matters. If you specify the position and the units in the same function call, then you must specify the units first if you want the position to use those units. If you specify the position first, MATLAB interprets the position in the current units and then converts the values to the new units.
For example, create a 0.2-by-0.3 inch rectangle. Specify the units before the position so that the position uses the new units.
annotation('rectangle','Units','inches','Position',[.1 .1 .2 .3])
If you specify the units after the position, then the annotation function interprets the position in normalized units (the default), and then converts the values to inches.
r = annotation('rectangle','Position',[.1 .1 .2 .3],'Units','inches');
r.Position
ans =
0.5833 0.4375 1.1667 1.3125
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!