Here is the code, but I need colored lines on the graph. How to do it?
explot ('2 * x ^ 3 - 3 * x ^ 2 + 5', [-5 5])
hold on
explot ('x ^ 3 / (x ^ 2-1)', [0 3])
axis tight
Answer 1
The ezplot
function returns a Line
object that represents the plotted plot. If the Color
property of this object is changed, the line color will change:
h1 = ezplot ('2 * x ^ 3 - 3 * x ^ 2 + 5', [-5 5]) ;
h1.Color = 'Green';
hold on
h2 = ezplot ('x ^ 3 / (x ^ 2-1)', [0 3]);
h2.Color = [0.3 0.2 0.5];