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 Live Editor, explore plotted data, 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

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

Editor and Live 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.

  5. Pres Esc twice to close the dialog box without sending feedback.

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 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 prompt (>>).

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

    y = cos(x)

    You hear:

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

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

    x = y

    You hear:

    x equals zero point five four zero three
    Ready prompt

  5. 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
    x equals zero point five four zero three

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

    Ready prompt
  7. Save the variables from the current workspace in the file test.mat by entering this statement in the Command Window.

    save test.mat

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

    Ready prompt

  8. Remove the variables from the workspace by entering this statement in the Command Window.

    clear

    You hear:

    All variables removed from workspace
    Ready prompt

  9. Clear all text from the Command Window by entering this 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 want to perform repeatedly from the command line or series of commands you want to reference.

For example, create, run, 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. Navigate to the toolstrip by pressing 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 file 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. Press Ctrl+S to save the file. MATLAB opens the Save As dialog box. You hear:

    Save as dialog

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

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

    Four variables added to workspace
    sz equals fifty one
    m equals zero point four eight nine nine
    Ready prompt

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

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

    Line one n equals fifty

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

    Line feed

  11. Delete the semicolon (;) and save your changes by pressing Ctrl+S.

  12. Press F5 to run the edited script. You hear:

    n equals fifty
    sz equals fifty one
    m equals zero point four five zero four
    Ready prompt

For more information about creating scripts, see Create Scripts.

Create Live Scripts Using a Screen Reader

Live scripts and live functions are program files useful for interacting with a series of MATLAB commands. Live scripts contain output and graphics with the code that produced them, together in a single interactive environment called the Live Editor.

For example, create and run a live script that calculates the area and volume of a sphere:

  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 pressing Ctrl+F6 until you hear:

    Toolstrip region
    Toolstrip tab control
    Home tab selected one of three

  3. Press the Tab key twice to enter the Home tab and select the New Live Script button. You hear:

    New live script button 
    Create a new live script in the current folder

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

    Untitled.mlx property page
    Edit multiline
    Code line one

  5. Add this code that creates a sphere with a radius of 1 and then calculates the surface area and volume of the sphere.

    [x,y,z] = sphere; 
    r = 1;
    A = 4*pi*r^2
    V = (4/3)*pi*r^3
  6. To run the live 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 live script and displays the output to the right of the code, by default. You hear:

    Six variables added to workspace
    Ready prompt

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

  7. Move focus to the output by pressing Ctrl+Shift+O. You hear:

    Variable output 
    V equals four point one eight eight eight

  8. Press the Up Arrow key to move to the previous output. You hear:

    Variable output 
    A equals twelve point five six six four

  9. Move focus back to the code by pressing Ctrl+Shift+O. You hear:

    Edit multiline
    Code line three has output
    A equals four star pi star r two

  10. Go to the top of the document by pressing the Up Arrow key until you hear:

    Code line one
    x y z equals sphere

  11. Press Alt+Enter to insert a line of text above the first line of code.

  12. Add this text to the line:

    Calculate Volume and Area of Sphere

  13. Press Ctrl+Alt+L to make the text line a heading.

For more information about creating live scripts, see Create Live Scripts in the Live Editor.

Open and Close Scripts and Live Scripts Using a Screen Reader

You can open and close existing MATLAB code files, including scripts and live scripts, using a screen reader and a keyboard.

For example, open and close 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 entering this statement in the Command Window.

    open myrandom.m
    You hear:
    Edit multiline 
    Start of document
    line one n equals 50

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

  3. To close myrandom.m, press Ctrl+Shift+F6 to move out of the document. You hear:

    Tab control 
    myrandom.m tab selected
    C MyWork myrandom.m one of one

  4. Press the Delete key to close the document. You hear:

    Command Window region
    Command Window edit multiline
    Greater greater

For more information about additional file actions, see Manage Files and Folders.

Explore Plotted Data Using a Screen Reader

Plotting data in figures allows visualization of data. You can use figures 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 entering 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:

    x equals one two three four five
    Ready prompt
    One variable added to workspace

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

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

    y = 2*x

    You hear:

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

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

    plot(x,y)

    You hear:

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

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

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

    Command Window region
    Command Window edit multiline
    Greater greater
  7. Add a title and legend to the figure.

    title("My Plot")
    legend

    You hear:

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

  8. Navigate to the new figure tab by pressing Ctrl+F6 until you hear:

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

  9. Press Tab twice to select the figure axes.

    You hear:

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

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

    You hear:

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

Delete Files Using a Screen Reader

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

For example, to delete the script myrandom.m in your current folder:

  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 entering 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 pressing 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 or Down Arrow key until you hear:

    myrandom.m script preview row collapsed level one

  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 about additional file actions, see Manage Files and Folders.

Related Topics