Main Content

Submit Solution in MATLAB Online

When you are assigned coding problems for a course in MATLAB® Grader™, you have the option of working on and submitting your solution using MATLAB Online™.

MATLAB Online provides access to the latest version of MATLAB from a standard web browser using MathWorks® hosted computing resources and storage. When you work on your solution in MATLAB Online, you gain access to the workspace, Live Editor, and debugging features of MATLAB. You do not need to download, install, or set up MATLAB.

Code, Debug and Analyze, and Submit Your Solution

  1. Open a coding problem in MATLAB Grader.

    Click Open Problem in MATLAB Online.

    • MATLAB Online displays the problem description, assessment and output tabs, and Run Pretest and Submit buttons in a MATLAB Grader panel on the left side. As with other panels in MATLAB Online, you can move the MATLAB Grader panel to the left or right side of the window.

    • When you open a problem in MATLAB Online, solution file or files are automatically created and opened for you.

    • If you are coding a solution using a function, a second file for the code to call your function is provided for you.

    • Any code you have already entered for your solution in MATLAB Grader is copied into the Live Editor when you open the problem in MATLAB Online.

  2. Code your solution in the Live Editor.

    • The instructor has written a description for the problem and provided guidance on how you are to solve it.

    • Lines with a gray background have been locked by your instructor, meaning you cannot edit them.

    • If you are writing a function solution, you must use the function name provided by the instructor so that MATLAB Grader can assess your solution. Remember to code the call to your function if your instructor has not provided that for you.

  3. Run the code and check your output.

    • Qualify your code by running it in the Live Editor. Output is shown in the Live Editor.

    • Run pretests if your instructor has provided them. Output is shown in the Output tab, and assessment results in the Assessments tab. You can learn about pretests in the topic Pretests.

    • MATLAB Grader imposes an execution time limit (for more information, see Execution Time Limit).

      If you get a warning that the server timed out, your solution took too long to run. Look for ways to speed up your code.

  4. Submit your solution.

    Review the results of assessments that were run during submission. To improve your solution, make changes to your code in the Live Editor.

    You must submit your solution for credit or grading, even if there are no assessments.

MATLAB Grader allows you to submit Late Solutions. Consult with your instructor on how late submissions are handled.

For more information about factors that can affect your submission, see the Solution Guide.

Working in MATLAB Online

  • MATLAB Grader Controls in MATLAB Online

    MATLAB Online displays the problem description, assessment and output tabs, and buttons to run pretest and submit in a MATLAB Grader panel on the left hand side of your browser. Like other panels in MATLAB Online, you can move the MATLAB Grader panel to the left or right side of the window.

    Image shows the MATLAB Online development application with the MATLAB Grader side panel on the left

    When you select Open Problem in MATLAB Online, MATLAB Online opens in a new browser tab. To return to MATLAB Grader, go to the browser tab where it is running and click the refresh prompt to see your solution in MATLAB Grader.

  • Running and Prequalifying Your Solution

    • You can run, debug, and analyze your code using the Live Editor. For more information about qualification, see Debugging and Analysis (MATLAB).

    • Code run in the Live Editor is run in the current MATLAB Online session, and output appears in the Live Editor.

    • When you submit your solution, pretests and assessments are run on the MATLAB Grader servers and output appears in the Output tab.

Review Assessment Results

You can view the results of all assessments in the Assessments tab. Pretests are included when assessments are run during submission.

  • If your solution passes all of the tests for this problem, MATLAB Grader marks the solution as correct. Tests that your solution passed have a green check mark.

  • If your solution fails one or more tests, MATLAB Grader marks the solution as incorrect. Each test that the solution failed includes an error message that indicates what caused the failure.

Image shows a list of tests and test results

To improve your solution, return to the Live Editor to make changes. To see other attempts you have made at solving this and other coding problems, return to MATLAB Grader.

Reset Template or Reopen Solution

While you are working on your solution, you can take the following actions:

  • Reset code — To revert any edits you made to the template and return the solution file (or files) to its original state, on the MATLAB Grader side panel, click the three horizontal dots and select Reset Your Solution. For a function-type problem, you can also reset the code that calls your solution with Reset Your Code to Call Your Function.

  • Restore code — To reopen a file you closed in the Live Editor, on the MATLAB Grader side panel, click the three horizontal dots and select Open Your Solution. For a function-type problem, you can also open the saved code that calls your solution with Open Your Code to Call Your Function.

Close Solution

If you have finished working on the problem and you want to continue working on other tasks in the same MATLAB Online session, you can close the solution.

To close the side panel and clean up the workspace, click the three vertical dots in the top-right corner of the MATLAB Grader side panel and select Close MATLAB Grader. If you have not saved your work, you are prompted to save before files are deleted.

Related Topics