Main Content

Use a Screen Reader in MATLAB Online

In MATLAB® Online™, you can use a screen reader and a keyboard to interact with the Command Window, create and edit scripts and functions in the Editor, and navigate through the MATLAB desktop tools. 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.

Navigate MATLAB Using a Screen Reader

When you first start MATLAB Online, the cursor is in the Command Window. To move forward through the different areas of the MATLAB Online desktop, press Ctrl+F6 (or Command+F6 on macOS systems). To move backward, press Ctrl+Shift+F6 (or Command+Shift+F6 on macOS systems).

By default, MATLAB Online has five areas that you can navigate to:

ToolPositionDescription
ToolstripTop of desktop

By default, the toolstrip includes three tabs, Home, Plots, and Apps.

To navigate between the toolstrip tabs, use the arrow keys. To enter and navigate within the toolstrip tabs, use the Tab key.

Current Folder ToolbarTop of desktop underneath toolstrip

View and change the current folder.

Current Folder BrowserLeft side of desktop

Manage files and folders in MATLAB. Actions include viewing, creating, opening, moving, and renaming files and folders in the current folder.

Workspace BrowserLeft side of desktop underneath Current Folder browser

View and manage the contents of the workspace in MATLAB.

Command WindowMiddle of desktop

Enter individual statements at the command line and view the resulting output.

Docked figuresMiddle of desktop. Above Command WindowPlot data in embedded figures.

For example, you can use the toolstrip to send feedback about the current release:

  1. On a Windows system with the NVDA screen reader running, open a Google Chrome browser and start MATLAB Online.

  2. With the cursor in the Command Window, press Ctrl+F6 to navigate to the toolstrip. You hear:

    Toolstrip region 
    Toolstrip tab control 
    Home tab selected one of three

  3. Press the Tab key to enter the Home tab and then continue pressing the Tab key until you reach the Feedback button. You hear:

    Feedback button
    Send us feedback or report a bug

  4. Press Enter. The Send Feedback dialog box opens.

For more information about the MATLAB desktop, see Change Desktop Layout.

Enter Statements in the Command Window Using a Screen Reader

As you work in MATLAB, you can enter individual statements in the Command Window using a screen reader and a keyboard.

For example:

  1. On a Windows system with the NVDA screen reader running, open a Google Chrome browser and start MATLAB Online.

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

    x = 1

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

    Greater greater
    X equals one

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

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

    y = cos(x)

    You hear:

    Y equals zero point five four zero three

  4. Set the value of x to the value of y by entering the following statement in the Command Window.

    x = y

    You hear:

    X equals zero point five four zero three

  5. Save the variables from the current workspace in the file test.mat by entering the following statement in the Command Window.

    save test.mat

    MATLAB saves the file in the current folder. You hear:

    Greater greater

  6. Remove the variables from the workspace by entering the following statement in the Command Window.

    clear

    You hear:

    Greater greater

  7. Clear all text from the Command Window by entering the following statement in the Command Window.

    clc

    You hear:

    Greater greater
    The Command Window is ready for the next statement.

For more information about entering statements in the Command Window, see Enter Statements in Command Window.

Create Scripts Using a Screen Reader

Scripts are the simplest kind of program file because they have no input or output arguments. They are useful for automating series of MATLAB commands, such as computations that you have to perform repeatedly from the command line or series of commands you have to reference.

Create and Run Scripts

You can create and run scripts using a screen reader and a keyboard.

For example to create and run the script myrandom.m:

  1. On a Windows system with the NVDA screen reader running, open a Google Chrome browser and start MATLAB Online.

  2. Navigate to the toolstrip by typing Ctrl+F6 until you hear:

    Toolstrip region
    Toolstrip tab control
    Home tab selected one of three

  3. Press the Tab key to enter the Home tab. The New Script button is selected. You hear:

    Home property page
    File grouping
    New script button 
    Create a new script in the current folder

  4. Press Enter to create a new script. MATLAB creates the script and opens it in the Editor. You hear:

    Untitled property page
    Edit multiline, line one

  5. Add this code that generates an array of random numbers and then calculates the size and mean of the array.

    n = 50;
    r = rand(n,1);
    
    sz = size(r)
    m = mean(r)
  6. Type Ctrl+S to save the file. MATLAB opens the Save As dialog box. You hear:

    Save as dialog
    Edit untitled.m

    Alternatively, you can open the Save As dialog box using the Save button on the toolstrip:

    1. Navigate to the toolstrip Editor tab by typing Ctrl+F6 until you hear:

      Toolstrip region
      Toolstrip tab control
      Editor tab selected four of seven

      If the Home tab is selected instead, you hear:

      Home tab selected one of seven
      To select the Editor tab, press the Right Arrow key until you hear:

      Editor tab selected four of seven
    2. Press the Tab key to enter the Editor tab and then continue pressing the Tab key until you reach the Save button. You hear:

      Clickable save button
      Save all modified files
      Ctrl plus S

    3. Press Enter to open the Save As dialog box. You hear:

      Save as dialog
      Edit untitled.m

  7. Type Ctrl+A to select the default file name and then enter a name for the script. For example, enter the name myrandom.m. Press Enter to save the file.

  8. To run the script, make sure that focus is inside the script, and then press F5. If focus is not inside the script, pressing F5 reloads MATLAB Online in the browser.

    MATLAB runs the script and displays the output in the Command Window. You hear:

    myrandom.m property page
    Edit multiline, line 2 
    n equals 50
    sz equals 50 1 
    m equals zero point five one seven two

    Alternatively, you can run the script using the Run button on the toolstrip:

    1. Navigate to the toolstrip Editor tab by typing Ctrl+F6 until you hear:

      Toolstrip region
      Toolstrip tab control
      Editor tab selected four of seven

      If the Home tab is selected instead, you hear:

      Home tab selected one of seven
      To select the Editor tab, press the Right Arrow key until you hear:

      Editor tab selected four of seven
    2. Press the Tab key to enter the Editor tab and then continue pressing the Tab key until you reach the Run button. You hear:

      Run grouping
      Clickable run button
      Save and run the active file
      F5

    3. Press Enter to run the script.

For more information about creating scripts, see Create Scripts.

Open and Edit Scripts

You can open and edit scripts using a screen reader and a keyboard.

For example, to open and edit the script myrandom.m:

  1. On a Windows system with the NVDA screen reader running, open a Google Chrome browser and start MATLAB Online.

  2. With the cursor in the Command Window, open myrandom.m by typing this statement in the Command Window:

    open myrandom.m
    You hear:
    myrandom.m property page
    Edit multiline, line 1 
    n equals 50

    Alternatively, you can open the script using the Open button on the toolstrip:

    1. Navigate to the toolstrip Editor tab by typing Ctrl+F6 until you hear:

      Toolstrip region
      Toolstrip tab control
      Editor tab selected four of seven

      If the Home tab is selected instead, you hear:

      Home tab selected one of seven

    2. Press the Tab key to enter the Editor or Home tab and then continue pressing the Tab key until you reach the Open button. You hear:

      Clickable open button
      Open file

    3. Press Enter. MATLAB opens the Open dialog box. You hear:

      Open dialog
      Type selected value open cancel
      Table clickable slash MATLAB Drive

    4. The Open dialog box contains a table with the list of files in your MATLAB Drive. Press Tab until the table is selected. Then, select myrandom.m by pressing the Up/Down Arrow until you hear:

      myrandom.m row

    5. Press the Tab key until you reach the Open button. You hear:

      Open button

    6. Press Enter to open the file.

  3. Use the arrow keys to navigate through the lines in the script and edit the code. For example, go to line 4 in the code by pressing the Down Arrow key until you hear:

    line 4 sz equals size r

  4. Go to the end of line 4 by pressing the Right Arrow key until you hear:

    Line feed

  5. Type a semi column (;) and save your changes by typing Ctrl+S.

Delete Scripts

You can delete scripts or other files or folders using a screen reader and a keyboard.

For example, to delete the script myrandom.m:

  1. On a Windows system with the NVDA screen reader running, open a Google Chrome browser and start MATLAB Online.

  2. With the cursor in the Command Window, type this statement:

    delete myrandom.m
    You hear:
    Greater greater

Alternatively, you can delete the script using the Current Folder browser:

  1. Navigate to the Current Folder browser by typing Ctrl+F6 until you hear:

    Current folder button expanded heading level two

  2. The Current Folder browser contains a table with the list of files and folders in the current folder. Press the Tab key to select the table. You hear:

    Current folder region
    Table

  3. Select myrandom.m by pressing the Up/Down Arrow until you hear:

    myrandom.m m row collapsed level 1

  4. Press the Delete key. The Delete File dialog box opens and you hear:

    Delete file dialog
    Question icon are you sure you want to delete this file?
    Clickable yes button delete file
    Button yes button no

  5. Press Enter to delete the file.

For more information, see Manage Files and Folders.

Explore Plotted Data Using a Screen Reader

Plotting data in figures allows visualization of data. They can be used to quickly survey data and display the output of code. You can explore figures using a screen reader and a keyboard.

For example:

  1. On a Windows system with the NVDA screen reader running, open a Google Chrome browser and start MATLAB Online.

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

    x = 1:5

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

    You hear:

    Greater greater
    X equals one two three four five

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

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

    y = 2*x

    You hear:

    Y equals two four six eight ten

  4. Plot the data of y against the data of x by entering the following statement in the Command Window.

    plot(x,y)

    You hear:

    Figure 1
    The current axes object contains one objects of type line

  5. Add a title and legend to the figure.

    title("My Plot")
    legend

    You hear:

    Figure 1
    The current axes object contains one objects of type line

  6. Navigate to the new figure tab by typing Ctrl+F6 until you hear:

    Tab control
    Figure 1 tab selected
    Figure 1, 1 of 1

  7. Press Tab twice to select the figure axes.

    You hear:

    Figure 1
    The current axes object contains one objects of type line
    The axes object with title my plot contains one objects of type line
  8. Type NVDA Modifier Key+Space to switch to focus mode for the figure axes. By default, the NVDA Modifier Key is the Insert key.

  9. Type Ctrl+Down Arrow to select the title inside the axes.

    You hear:

    Text my plot
  10. Press Tab to select the line object. If axes contain multiple objects, press Tab to navigate through them.

For more information about exploring plotted data, see Interactively Explore Plotted Data.

Screen Reader Tips and Limitations

Reduce Blank Lines in Output

To improve the screen reader experience when working in the Command Window, suppress excess blank lines in output for the current session using the format command.

format compact;

To maintain the compact format across all future sessions, use settings to set the personal value for line spacing in output display.

s = settings;
s.matlab.commandwindow.DisplayLineSpacing.PersonalValue = 'compact';

Modifying Graphics Objects

When working with graphics objects, avoid using the property inspector to view and modify properties. Instead, view and modify graphics object properties programmatically. For example, the plot function returns a chart line object. You can use dot notation to view and set properties.

p = plot(1:10,1:10);
p.LineWidth = 3; 

Alternatively, you can set properties using name-value pair arguments when creating the object, such as plot(1:10,1:10,'LineWidth',3).

For more information about viewing and modifying graphics object properties, see Modify Graphics Objects.

Accessing MathWorks Documentation

To ensure the best experience when viewing and searching the documentation using a screen reader, open it in a separate browser tab or window at https://www.mathworks.com/help/.

Live Editor

Using a screen reader is not supported in the Live Editor. To create scripts and functions, use the Editor instead.

Related Topics