![](https://csdnimg.cn/release/download_crawler_static/9041083/bg3.jpg)
When you are finished, run ex1.m (assuming you are in the correct di-
rectory, type “ex1” at the Octave/MATLAB prompt) and you should see
output similar to the following:
ans =
Diagonal Matrix
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
Now ex1.m will pause until you press any key, and then will run the code
for the next part of the assignment. If you wish to quit, typing ctrl-c will
stop the program in the middle of its run.
1.1 Submitting Solutions
After completing a part of the exercise, you can submit your solutions for
grading by typing submit at the Octave/MATLAB command line. The sub-
mission script will prompt you for your login e-mail and submission token
and ask you which files you want to submit. You can obtain a submission
token from the web page for the assignment.
You should now submit your solutions.
You are allowed to submit your solutions multiple times, and we will take
only the highest score into consideration.
2 Linear regression with one variable
In this part of this exercise, you will implement linear regression with one
variable to predict profits for a food truck. Suppose you are the CEO of a
restaurant franchise and are considering different cities for opening a new
outlet. The chain already has trucks in various cities and you have data for
profits and populations from the cities.
3