Question: I need help with matlab 1. Create a function called mb_line.m that takes as input two points, identified as (x1,y1) and (x2, y2) and produces
I need help with matlab
1. Create a function called mb_line.m that takes as input two points, identified as (x1,y1) and (x2, y2) and produces the output of slope and yintercept value.
2. Create a script called use_line.m that does the following
(a) gets the x and y values;
(b) calculates the slope and b value;
(c) plots a figure with the line using a grid and blue color line
(d) create a title that includes the equation and the value of slope and yintercept value
(e) create a label on the x axis that shows the x values of each point defined earlier
(f) create a label on the yaxis that shows the y values of each point defined earlier
(g) plot the points as red "+ signs" on top of the line
Please note you may need a specific command executed between the two plots to keep the line and its points on the same figure
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
