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.

To start using MATLAB Online, go to https://matlab.mathworks.com/ and click the Open MATLAB Online button.

Screen Reader Tips

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, view and modify properties programmatically or use the Property Inspector. 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 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/.

Using MATLAB with -nodesktop Option

If you run MATLAB without the desktop using the -nodesktop start-up option, these tips can help improve your screen reader experience:

  • Use the format function to suppress excess blank lines in output, making it easier to navigate diary files. For more information, see Reduce Blank Lines in Output.

  • Include a filename when calling the diary function to save the Command Window text to a separate file. You can call the diary function multiple times during a MATLAB session with different filenames to save different sets of text to different files.

For a more accessible alternative to using MATLAB with the -nodesktop option, use the Command Window Only layout in MATLAB Online instead. Using the Command Window Only layout in MATLAB Online gives you access to more keyboard shortcuts and, when needed, the full functionality of the MATLAB desktop. To select the Command Window Only layout in MATLAB Online, go to the Home tab, and in the Environment section, click the Layout button and then select Command Window Only.

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). You also can use a keyboard shortcut to navigate directly to some open tools.

This table describes the different areas of the MATLAB Online desktop and their default positions.

AreaPositionDescription
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.

Files panelLeft 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 panelLeft side of desktop underneath Files panel

View and manage the contents of the workspace in MATLAB.

Command WindowBottom middle of desktop

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

EditorMiddle of desktop, above Command Window

Edit or create files.

Docked figuresMiddle of desktop, above Command Window

Plot 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:

    Ready prompt
    x equals one
    One variable added to workspace

    When you hear Ready prompt, 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:

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

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

    x = y

    You hear:

    Ready prompt
    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:

    Ready prompt

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

    clear

    You hear:

    Ready prompt
    All variables removed from workspace

  7. 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 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.

  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.

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.

  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, delete myrandom.m by typing this statement in the Command Window:

    delete myrandom.m
    You hear:
    Ready prompt

Alternatively, you can delete the script using the Files panel:

  1. Navigate to the Files panel by typing Ctrl+F6 until you hear:

    Complimentary landmark files button heading level two
  2. The Files panel contains a table with the list of files and folders in the current folder. Press the Tab key to select the table. You hear:

    Files region
    Table

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

    myrandom.m script preview 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:

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

  1. 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:

    Ready prompt
    x equals one two three four five
    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 = 2*x

    You hear:

    Ready prompt
    y equals two four six eight ten
    One variable added to workspace

  3. 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

  4. Bring the cursor back to the Command Window by pressing Ctrl+F6 until you hear:

    Command Window button 
    heading level two
  5. Enter the Command Window by pressing the Tab key. You hear:

    Command Window region
    Command Window edit multiline
    Greater greater
  6. 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

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

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

  8. 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
  9. Type NVDA Modifier Key+Space to switch to focus mode for the figure axes. By default, the NVDA Modifier Key is the Insert key.

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

    You hear:

    Text my plot
  11. 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.

Limitations

Live Editor

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

Related Topics