Zoom and center Simulink model program (alt+1 & spacebar)
30 次查看(过去 30 天)
显示 更早的评论
Trying to program the same functionality as you see in the "alt+1" and "spacebar" shortcuts into a callback function that will run when you open a model. The best I have found is the Simulink.scrollToVisible function but that doesn't seem to always zoom to 100% and center the models.
2 个评论
Gautam
2016-5-23
Hi Richard,
There's a 'Fit to View' option in the Explorer Bar(the bar that appears on the left hand side of the Simulink model). It essentially performs the same function as 'alt+1' and 'Spacebar' shortcuts.
采纳的回答
James
2016-9-6
Hi Richard,
You can set the Simulink window's view using the system's 'Zoomfactor' parameter. For example:
set_param(gcs,'Zoomfactor','fit to view')
will zoom and centre the current Simulink system as the spacebar does.
1 个评论
Simon Greenwold
2017-2-17
You can either fit the entire system with
set_param(gcs, 'ZoomFactor','FitSystem')
or just what's currently selected with
set_param(gcs, 'ZoomFactor','FitSelection')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Analysis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!