You are on page 1of 4

Homework Template for Matlab Assignments

These are meant to act as a guide to Matlab homework submissions. The details of this format are just the
way I tend to do it. You mayin factyou will do it slightly differently the way I do, but what I am
looking for are these key things:

1) M-files, which should have:
a) Proper filename format
b) Pertinent student and assignment information
i) Name
ii) Course
iii) Assignment
iv) Problem
c) Script for the problem
d) Script output
2) One word document, which should have:
a) Proper filename format
b) A copy of the contents of each and every m-file
c) A copy of any graphic output such as figures
3) Your blackboard submission should have two files:
a) The one word document
b) One zipped/compressed folder containing all m-files

Following is an example of this format using homework 6.

First, do the problem and write your code (shown here is example 3.6 from homework 6). You should
include such information as your name (% Bryce Melton), course and section number (% EGRM
215-901), and assignment and problem number (% HW6 Ex3.6).











Now, write a section header for the output (%% Output), run the code, and paste the output into the m-
file after this header as shown below. If you have to call the m-file as a function with inputs, include that
call in your output section. This way I know what inputs you used.

















As shown above, highlight the output you just pasted and comment it out as shown below.



!







Next, paste all the contents of that m-file into a word document as shown below.



















Do this for each m-file, pasting the contents of each into the same word document. Paste any figures or
graphic output after this. You should have a set of files like this in the end:















Note that every m-file filename has the last name (Im not as concerned about the first initial),
assignment, and problem corresponding to that m-file, in that order (these were all examples from the
book, so I used Ex for example, but typically I would say Prob or Problem). The word document
follows an identical, yet shortened filename format because it contains all the problems from that
homework set. Again, the single word document contains a copy of the contents of each and every m-file
you submit.

Finally, package the m-files into a zipped/compressed folder and name using the filename format. Do not
put the word document into this folder. Submit these two files (the word document and the
zipped/compressed folder) on blackboard.

You might also like