MATLAB: Do I get an error when setting the LineStyle property for multiple lines in MATLAB 7.4 (R2007a)

MATLAB

When I executed the following commands in R2007a…
h = plot(rand(10,6))
set(h, {'LineStyle'}, {'-';'--o';'--x';':';':';':'})
I received the following error:
??? Error using ==> set
Bad property value found.
Object Name : line
Property Name : 'LineStyle'.

Best Answer

The "LineStyle" property for a line object only accepts values of '-', '--', ':', '-.' or 'none'. You can use the "Marker" property to separately set marker symbols. To illustrate, here is an example:
h = plot(rand(10,6))
set(h, {'LineStyle'}, {'-';'--';'--';':';':';':'})
set(h, {'Marker'}, { 'none'; 'o'; 'x'; 'none'; 'none'; 'none'; })
For further help with Line properties in R2007a, refer to the corresponding documentation:
For your reference, here is a link to the corresponding documentation for a more recent MATLAB version, e.g. R2018b: