Here's how you can plot a polynomial with given roots on a given interval with markers at selected points in Matlab:
main.m371 chars14 lines
This code first defines the polynomial with the given roots using the poly()
function. It then defines the interval for plotting and the number of values on that interval using linspace()
. The polyval()
function is then used to evaluate the polynomial at the selected points. Finally, the plot()
function is used to plot the polynomial on the interval with markers at the selected points. The o
argument specifies the marker shape.
gistlibby LogSnag