color1 = 'blue' color2 = 'green' text = 'to embed an apostrophe isn''t hard' combo = [color2, '-', color1] combo(length(combo) + 1) = 's' ch = combo(7) combo(7:end) = 'black'
+ - * / ^ \
Operators use rules of linear algebra:
for scalars, scalar arithmetic is done
for matrices, matrix arithmetic is done
plot( xcoords, ycoords, 'spec' )
Example: plot y = 4x2cos(x) - 3x + 7 over the range x = 2 to 30
Example: plot the points (1,1), (3,4), (5,8), (2,9), (7,2)
plot( xcoords1, ycoords1, 'spec1', xcoords2, ycoords2, 'spec2' )
Example: plot y = cos(x) and y = 0.5x2 - 2x + 1 for x = 0 to 3π
figure
legend('curve1', curve2')
text(x, y, 'text')
axis( [ xmin, xmax, ymin, ymax ] )
axis equal