Question: Write an m - file that computes y values for two straight lines straight lines based on the formula y = mx + b using

Write an m-file that computes y values for two straight lines straight lines based on the formula y = mx + b using the following information.
Define 2 row vectors x1 and x2 as follows:
x1 a vector that starts at 3 and ends at 21 with increments of 2
x2 a vector that starts at 2 and ends at 19 with 25 data points
Calculate the vectors: y1 and y2 using the equation of a line (use m1 & b1 with x1, etc.) given the following slopes and y-intercepts:
m1=0.25; b1=3
m2=-2; b2=10
Do not display any of your x or y values to the command window.
Using the array functions and indexing taught in class, determine and output:
The average value of y1
the value of x2 for the largest value of y2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!