Main Content

Accessibility in MATLAB

MATLAB® provides several features to help make it accessible to users. To navigate MATLAB using just a keyboard, you can use keyboard shortcuts. In MATLAB Online™, you can use a screen reader and a keyboard to interact with the different tools in MATLAB. To make the desktop more visible, you can zoom in, change its colors, or increase the clarity of plots. You can also use data sonification to explore and interpret data by sound.

For our best accessibility support, use MATLAB Online. MathWorks® is committed to improving the accessibility of its software products, focusing first on the accessibility of MATLAB Online. See our Accessibility Statement for MATLAB for the latest information on accessible workflow support.

Navigate Using the Keyboard

You can use keyboard shortcuts to navigate MATLAB with just a keyboard. Navigating with a keyboard differs depending on whether you are using MATLAB Online or an installed version of MATLAB.

In MATLAB Online, to move forward through the different areas of the MATLAB Online desktop, press Ctrl+F6. To move backward, press Ctrl+Shift+F6. On macOS systems, use the Command key instead of the Ctrl key. To display a list of navigational keyboard shortcuts, press Ctrl+/.

In an installed version of MATLAB, to move forward through the different areas of the MATLAB desktop, press Ctrl+Tab. To move backward, press Ctrl+Shift+Tab. To select a toolstrip tab, press Alt to show the access keys for the tabs and then <character> to select the tab, where <character> is the displayed access key for the desired tab. After selecting a tab, press <character> to select an item on the tab, where <character> is the displayed access key for the desired toolstrip item. Accessing the toolstrip using keyboard shortcuts in an installed version of MATLAB is not supported on macOS.

For more information, see Use Keyboard Shortcuts to Navigate MATLAB.

Work with a Screen Reader

In MATLAB Online, you can use a screen reader and a keyboard to interact with the Command Window, create and edit scripts, live scripts, and functions in the Editor and Live Editor, and navigate through the different areas of the MATLAB desktop. MATLAB Online is tested with the NVDA screen reader on Windows® 10 running MATLAB Online in the Google Chrome® browser. For more information about NVDA, see Get Help on the NV Access website.

For example, on a Windows system with the NVDA screen reader and MATLAB Online running, enter individual statements in the Command Window.

  1. With the cursor in the Command Window, create a variable named x by entering this statement in the Command Window.

    x = 1

    MATLAB adds x to the workspace and displays the results in the Command Window. You hear:

    X equals one
    Ready prompt
    One variable added to workspace

    When you hear Ready prompt, the Command Window is ready for the next statement at the command-line prompt (>>).

  2. Create another variable y by entering the following statement in the Command Window.

    y = cos(x)

    You hear the results:

    Y equals zero point five four zero three
    Ready prompt
    One variable added to workspace

  3. Move the cursor to the Command Window scroll buffer region to hear the last output again by pressing Shift+Tab. You hear:

    Scroll buffer region
    Y equals zero point five four zero three

  4. Move the cursor back to the command-line prompt by pressing Shift+Tab. You hear:

    Ready prompt
  5. Clear all text from the Command Window by entering the following statement in the Command Window.

    clc

    You hear:

    Ready prompt
    The Command Window is ready for the next statement.

For more information, see Use a Screen Reader in MATLAB Online.

Zoom

You can adjust the zoom level in MATLAB. The way you zoom differs depending on whether you are using MATLAB Online or an installed version of MATLAB.

In MATLAB Online, you can zoom in and out of the entire desktop by adjusting the zoom settings for your web browser.

In an installed version of MATLAB, you can change the zoom level in the Editor and Live Editor. To zoom in and out, hold the Ctrl key and move the scroll wheel. On macOS systems, use the Command key instead.

Alternatively, you can zoom in and out using the available keyboard shortcuts.

ActionKeyboard Shortcut

Zoom in

Ctrl+Plus

On macOS systems, use Command+Shift+Plus

Zoom out

Ctrl+Minus

On macOS systems, use Command+Shift+Minus

Reset Zoom

Ctrl+Alt+0

On macOS systems, use Command+Alt+0

For tools such as the Command Window, Current Folder browser, and Workspace browser, you can increase or decrease the displayed font size using font preferences. For more information, see Zoom and Change Desktop Fonts.

Maximize Focus Area When Zooming

To maximize the space for your current area of focus when zooming, minimize the tools that you are currently not using. In MATLAB Online, to minimize a tool, click its icon in the sidebar. For example, if the MATLAB Online desktop is in the default layout with the Files panel and Workspace panel open on the left side of the desktop, you can hide both tools by clicking the icon group for the two tools in the left sidebar. If two or more tools are grouped together, you can minimize each individual tool by clicking the Collapse button to the left of its title bar.

MATLAB desktop with the Files panel collapsed and the Workspace panel expanded. The Files panel and Workspace panel icon group and the Files panel collapse button are circled in red.

In an installed version of MATLAB, to minimize tools such as the Current Folder browser, Command Window, Editor, and Live Editor, on the title bar of the tool, click the action menu button and select Minimize. For example, to minimize the Current Folder browser, at top right of the Current Folder browser, click the action menu button and select Minimize.

For more information about minimizing tools, see Change Desktop Layout.

Change MATLAB Desktop Colors

You can change the text and background colors for certain desktop tools in MATLAB, including the Editor, Command Window, Current Folder browser, Workspace browser, and Import Wizard.

To change the text and background colors:

  1. In the Command Window, type preferences Colors to open the Preferences window with the MATLAB Colors Preferences page selected.

  2. In the Desktop tool colors section, clear the Use system colors check box.

    In MATLAB Online, the Use system colors check box is not available and this step can be skipped.

  3. Use the Text and Background fields to change the colors. For example, select white for the text color and black for the background color.

    The Syntax Highlighting sample and Command Window sample areas show a preview of the selected colors.

    Sample panels showing a dark grey background and white text

To restore the default text and background colors, click the Restore Default Colors button at the bottom of the Preferences window.

In MATLAB Online, you also can use themes to change the colors of the MATLAB desktop.

To select a theme:

  1. In the Command Window, type preferences Appearance to open the Preferences window with the MATLAB Appearances Preferences page selected.

  2. Select a MATLAB Theme. For example, select a dark theme.

For more information about the different ways to change the desktop colors in MATLAB, see Change Desktop Colors.

Increase Clarity of Plots

You can increase the clarity of plots in MATLAB by changing the color and size of markers, lines, and text within the plots. To change the color and size of markers, lines, and text, modify the properties of the plot. The list of properties for a plot depends on the object type it creates. For more information, see the documentation for the plot function you are using. You also can use the colororder function to change the color palette used for the markers and lines within the plots.

For example, create a plot with three lines.

p = plot([1 2 3; 4 5 6],'LineWidth',2)
title("Three Colored Lines")
legend("Line 1","Line 2", "Line 3")

Line plot with a blue line, a red line, and a yellow line

Enhance the distinction between the three lines using the LineWidth, Marker, MarkerEdgeColor, and MarkerSize properties. For more information, see Line Properties.

p(1).LineWidth = 2;
p(1).Marker = "*";
p(1).MarkerEdgeColor = "b";
p(1).MarkerSize = 8;

p(2).LineWidth = 3;
p(2).Marker = "diamond";

p(3).LineWidth = 4;

Line plot with a blue line with blue star-shaped markers at each data point, a slightly thicker red line with diamond-shaped markers at each data point, and an even thicker yellow line

To change the font size for objects in a plot, you can use the fontsize function. For example, increase the font size of the title, legend, and axes labels in the plot until they are more easily readable.

fontsize(gcf,"increase")
fontsize(gcf,"increase")
fontsize(gcf,"increase")

Line plot with larger title, legend, and axes label text

To improve the contrast of lines and markers within a plot, you can use the colororder function and specify the "dye" color palette. The colors on the "dye" palette meet international contrast ratio standards for enhanced accessibility against a white background. For example, specify the "dye" color palette for the plot.

colororder("dye");

Line plot with a dark red line, a light green line, and a purple line

Convert Data to Sound Using Sonification

You can convert data to sound using the sonify function. For example, convert a vector of sine values to sound and return the sonified data s and sample rate Fs.

y = sin(1:10);
[s,Fs] = sonify(y);

You can use the sonified data with the audioplayer function to play, pause, resume, and stop the sound. You also can write the sonified data to a WAV file using the audiowrite function.

See Also

|

Related Topics