5.0

5.0 | 1 rating Rate this file 7 Downloads (last 30 days) File Size: 200.15 KB File ID: #24017

Zoom Functionality in MATLAB and Simulink Using Mouse Wheel

by Hamid Satarboroujeni

 

06 May 2009 (Updated 26 May 2009)

Enable zoom in/out in MATLAB Command window, Simulink models, and Simulink dialogs using mouse wheel

| Watch this File

File Information
Description

When running, this application will enable the standard zoom functionality in MATLAB Command window, Simulink models, and Simulink Dialogs.

For using this functionality in MATLAB Command window, you need to enable MATLAB Automation Server.When you first run this application it will give a prompt for doing that for you.

When it is running, hold the CTRL (Control) key on your keyboard and scroll the mouse wheel to zoom in/out in MATLAB Command window, a Simulink model, or a Simulink dialog depending on which one is present and active.

If you are in MATLAB command, you can use CTRL+b to make the text bold (and back to plain).

MATLAB release MATLAB 7.8 (R2009a)
Other requirements Works on all versions of MATLAB
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
15 May 2009 Thierry Dalon

The ML zoom in command window does not seem to work. (I use R14SP3). BTW it opens another command window.

15 May 2009 Hamid Satarboroujeni

Hi Thierry,

Thank you for your interest in the tool. I recently realized that for some unknown reason the tool does not work for some mouses (like Lenovo mouse). Change your mouse to see if the tool works. If not, then these are possible sources of problem I can think of:

1- The tool must be launched AFTER you have an existing MATLAB session. Even if you don’t have MATLAB open it prompts you to launch MATLAB for you. So, to be safe open MATLAB first and then launch the tool.

2- MATLAB Automation Server must be enabled for the tool to work. It can automatically enable Automation Server for you by running the following command at your existing MATLAB command window:
>> enableservice('AutomationServer',true);
If it does not do it for you (which I doubt), then run it manually.

3- The zoom functionality only works in the desktop tools that use Desktop code. By default, the command window, command history and the editor use this code. To make sure your command window is using Desktop code, go to MATLAB preferences (file -> Preferences -> Font -> Custom) and make sure in the list of Desktop Tool, Command Window is using Desktop Code

4- If it’s not working after you follow the steps above, then you probably don’t have the Microsoft Scripting Control installed on your machine. It’s almost always available on Windows machines by default, but to make sure you have it go to the following location
C:\WINNT\system32
and look for msscript.ocx. If you don’t have it, you can easily download it directly from Microsoft and install it (http://www.microsoft.com/downloads/details.aspx?FamilyId=D7E31492-2595-49E6-8C02-1426FEC693AC).

If none of these resolve the issue, then try these commands to see if you get any errors:

%Get the current font size:
com.mathworks.services.FontPrefs.convertJavaToPointFont(com.mathworks.services.FontPrefs.getCodeFont()).getSize

%Is the font PLAIN?
com.mathworks.services.FontPrefs.convertJavaToPointFont(com.mathworks.services.FontPrefs.getCodeFont()).isPlain

%Change the font size to 12
com.mathworks.services.FontPrefs.setCodeFont(java.awt.Font('Monospaced',java.awt.Font.PLAIN,12))

%Make it bold
com.mathworks.services.FontPrefs.setCodeFont(java.awt.Font('Monospaced',java.awt.Font.BOLD,12))

07 Oct 2011 Chee Syn Ang

Great tool to be used during presentation or teaching.

Please login to add a comment or rating.
Updates
26 May 2009

Fixed the issue of opening an extra instance of MATLAB when an exiting MATLAB session was detected.

26 May 2009

Fixed the issue of opening an extra instance of MATLAB when an exiting MATLAB session was detected.

Tag Activity for this File
Tag Applied By Date/Time
mouse wheel Hamid Satarboroujeni 06 May 2009 16:57:00
matlab command window Hamid Satarboroujeni 06 May 2009 16:57:00
simulink Hamid Satarboroujeni 06 May 2009 16:57:00
zoom Hamid Satarboroujeni 06 May 2009 16:57:00
simulink dialog Hamid Satarboroujeni 06 May 2009 16:57:00

Contact us at files@mathworks.com