Recall that a piecewise linear function f(x) is given by means
of two vectors X and Y which give the “vertices” of the graph of f
(that is, the Matlab command plot(X,Y) would display the graph of
f). Download the file plrootsxy.m from this test’s web page. It
contains a Matlab function which is a variation of the function
plroots from Section 24 of the notes of this course. The function
plrootsxy(X,Y) has two inputs X and Y which define a piecewise
linear function f(x), and its output is a vector containing the
roots of the function f(x). Consider the piecewise linear function
f(x) whose graph is:
Write a Matlab script that
(a) Creates two vectors X and Y such that plot(X,Y) gives
the graph of f(x), then make a plot of the graph. (b) Uses
the function plrootsxy in order to find the roots of f(x) and
display them on the screen. Your script must print nothing else on
the screen (marks will be deducted).
Upload your script.
Recall that a piecewise linear function f(x) is given by means of two vectors X and Y which give the “vertices” of the g
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Recall that a piecewise linear function f(x) is given by means of two vectors X and Y which give the “vertices” of the g
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!