There are always 2 or 3 things that need to be included in a project submission:

The matlab code can be submitted in one of the following formats:

Project 1

Project 2

Example of Types of Files

Suppose we were asked to find the LU factorization of some matrices A and B using Matlab.

You could type all your codes into the command line, write down what you found for L and U, and copy the codes you used in a text file. This is perfectly acceptable, and for those of you with limited computer experience or are feeling like matlab hates you, I would reccomend this approach.

There is another option:
you could write a matlab function that takes in a matrix and then displays the L and U of the LU factorization and/or you could put all your code into a script file and making sure there are no semicolons at the ends of the lines, you could publish this script. See below for example:

Notice here that publishing a .m file makes it look really nice; however, you'll only get good results if
(a) you don't put semicolons at the end of the lines -- this means the output of those lines will be displayed in the published file
(b) you put comments in between the various sections