can you plot two sets of row by column vectors in one plot in matlab

To plot two sets of row by column vectors in one plot, you can use the plot function and specify the x and y data for each set. Here is an example:

main.m
x1 = 1:10;      % x data for first set
y1 = rand(1,10); % y data for first set

x2 = 1:10;      % x data for second set
y2 = rand(1,10); % y data for second set

plot(x1, y1, 'b-', x2, y2, 'r--'); % plot both sets with blue solid line and red dashed line
legend('Set 1', 'Set 2'); % add legend to show which set is which
xlabel('X Axis'); % add label to x axis
ylabel('Y Axis'); % add label to y axis
title('Two Sets of Row by Column Vectors'); % add title to plot
465 chars
12 lines

This will plot two sets of row by column vectors in one plot, with different line styles for each set and a legend to differentiate them.

related categories

gistlibby LogSnag