Work on MATLAB homework in a browser and hand in .m files
If you do not have MATLAB to hand, you can still draft and test a script in a browser tab, then take it out as the files your course expects. Save as MATLAB project writes a zip that unpacks to one folder: your code as a .m script, the function files it uses, the data files it reads, and a printable report.
The engine is an independent implementation, not MATLAB. Before you submit, run the saved folder in MATLAB or Octave, because that is what your marker will use.
Open this sheet in Calcs Open a blank sheet
The steps
- Open your
.mfiles with File, Open or by dropping them on the page. Function files go to the library, and the script opens as a worksheet. - Add the data files you use (CSV or text) the same way.
- Run the script. Prints, errors and plots appear in the sheet; an error names the line.
- Choose File, Save as MATLAB project (.zip).
What is in the zip
<name>/<name>.m: the code of the worksheet's blocks, one%%section per block.- Every function file the code calls, beside it at the top level, so MATLAB finds them with no path setup.
- Every data file the code names in a string, beside the script, so relative file names work.
report.html: the worksheet as calculated, with plots and results.README.txt: how to run it and what is not included.
Keeping the whole job in one file
Save with its files (.cpz) writes the worksheet and its data and function files as one bundle that opens here again with everything in place. That is for carrying your own work between machines. The MATLAB project zip is for handing code over.
Before you submit
- Run the saved script in MATLAB or Octave and compare the output. Results should agree for ordinary code, but this engine is not guaranteed identical to MATLAB.
- Check that your course allows the tools you used. Some assignments require an autograder or particular toolboxes that are not here.
- Features not supported here:
classdef,matfile, 64-bit integers beyond 253, apps and interactive figures, and toolboxes.
MATLAB is a trademark of The MathWorks, Inc. CivilKit Calcs is not made by, affiliated with or endorsed by The MathWorks. The name is used here only to say which language the code is written in.
Questions
Can I submit the zip?
It unpacks to ordinary .m files, data files and an HTML report. Whether your course accepts that is for your instructor; check their rules.
Do I need MATLAB to use this?
No, to write and test. You do need MATLAB or Octave to confirm the saved script runs the way your marker will run it.
Where are my files stored?
In your browser, on your machine. Nothing is uploaded. Save the zip or the .cpz to keep a copy.
Do plots come with the zip?
The script redraws them when run in MATLAB or Octave, and report.html shows them as the sheet drew them.