%plotD.m plot the letter D % P. Conrad for CISC106, 10/16/2007 with help from Drew Pavlick % set up cell array myPlot = cell(1,2); myPlot{1,1} = [ 0 0 2 3 4 4 3 2 0]; myPlot{1,2} = [ 0 8 8 7 5 3 1 0 0]; plotAll(myPlot); axis ([ -1 5 -1 9 ]) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % plot the current plot to the file letterA.jpg % and make it readable on the web %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% dirName = '~/public_html/cisc106/10.16'; fileName = 'letterD.jpg'; fullFileName = [ dirName '/' fileName]; system(['mkdir -p ' dirName]); print('-djpeg', fullFileName); system(['chmod -R 755 ' dirName]); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Print out a URL to access the file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % retrieve the current username [status, myUserName] = system('whoami'); % remove any extra space at start and end of myUsername myUserName = strtrim(myUserName); % build the URL by susbtituting ~/public_html with % http://copland.udel.edu/~username inside the dirName URLprefix = ['http://copland.udel.edu/~' myUserName]; theURL = [strrep(dirName,'~/public_html',URLprefix) '/' fileName ]; % print a message with the URL fprintf('Visit %s to see the plot\n',theURL);