A Structure for Lines and Points
â— Create a structure to store line segments and points. Each line has a starting X and Y, an ending X and Y, a color, and an optional symbol. Each point has a starting X and Y, a color, and a symbol. Make a function to plot all of the line segments and points in an array of structure elements. The colors and symbols should be compatible with MATLABâ€™s plot function, such as b for blue.The following code may be helpful as a template.plot(10, 20, 'r*');hold onplot([1, 10], [1, 20], 'g');
This plots a red asterisk at (10, 20), then draws a green line from (1, 1) to (10, 20).