How do I make colored lines and markers in the ezplot function?

Here is the code but I need to have colored lines on the graph how do I do this?

explot ('2*x^3 - 3*x^2 + 5', [-5 5])
hold on
explot ('x^3/(x^2-1)', [0 3])
axis tight
 0
Author: dem89, 2020-02-10

1 answers

The ezplot function returns an object of type Line representing the drawn graph. If you change the Color property of this object, 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];
 0
Author: AVK, 2020-02-13 05:22:47