TASK: Make a plot of the letters "VT", joined or separate, and filled in with a color.
COMMENT: The MATLAB "fill" command can outline a shape and fill it with a color.
To draw a triangle, and fill it with red, we could use the commands:
xlist = [ 0.0, 3.0, 1.0 ]; ylist = [ 0.0, 1.0, 4.0 ]; fill ( xlist, ylist, 'r' );
A simple "VT" plot can be made this way. You should do this on a sheet of graph paper. Arrange "fat" versions of the letters "V" and "T" and make a list of the x and y coordinates of their corners. If the V and T are separate, you will need two separate lists, and two fill commands.
INSTRUCTIONS (for two separate V and T letters):
Define X and Y coordinates for "V" nodes: vxlist = vylist = Define X and Y coordinates for "T" nodes: txlist = tylist = Since you are going to issue two fill commands, start with a "hold on" command. Issue the fill commands for your "V" and "T": fill ( ?, ?, YOUR COLOR ); fill ( ?, ?, YOUR COLOR ); YOUR COLOR can be a standard MATLAB color, such as 'r' or 'b'. or you can define one of the official VT colors: orange = [ 1.0, 0.4, 0.0 ]; maroon = [ 0.4, 0.0, 0.0 ]; and say fill ( ?, ?, orange ); Then give a "hold off" command. Your plot may look squashed. Force MATLAB to use the same scale in X and Y using the command: axis ( equal ) MATLAB likes to show the X and Y axis. For this plot, we don't want them, so add the command: axis off Your last command should save a copy of your plot: print ( '-djpeg', 'hw035.jpg' );
CHECK:(I combined the two letters, and I added a plot() command
to draw a border around them.)
SUBMIT: I only need your script file "hw035.m". I do NOT need your plot file. Your script file should begin with:
% hw035.m % YOUR NAME % This script (describe what it does)