Tutorial by Examples

In this example we are going to plot multiple lines onto a single axis. Additionally, we choose a different appearance for the lines and create a legend. % create sample data x = linspace(-2,2,100); % 100 linearly spaced points from -2 to 2 y1 = x.^2; y2 = 2*x.^2; y3 = 4*x.^2; ...
Interleave your y or x values with NaNs x = [1:5; 6:10]'; x(3,2) = NaN x = 1 6 2 7 3 NaN 4 9 5 10 plot(x)
In MATLAB, we can set new default custom orders, such as a colour order and a line style order. That means new orders will be applied to any figure that is created after these settings have been applied. The new settings remains until MATLAB session is closed or new settings has been made. Default ...

Page 1 of 1