Plot line segments in matlab
% the stupid way plot([0, 1], [0, 2.1]) hold on plot([0, 1], [0, 3.211]) plot([0, 1], [0, 4.51]) plot([0, 1], [0, 6.31]) % the vectorized, smart way x = [0 0 0 0; 1 1 1 1] y = [0 0 0 0; 2.1 3.1 4.1 5.1] plot(x, y)
lines, vectorization

0 comments:
Post a Comment