numtracks

numtracks - max = 14; min = 1; persistent cdnum; p if...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%This function uses persistent variable to designate the number of tracks %on each of the three CDs uploaded onto the CD player and then prints the %number of tracks on each CD for the listener. function tracks = numtracks()
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: max = 14; min = 1; persistent cdnum; p if isempty(cdnum) cdnum = 1; end if(cdnum > 3) cdnum = 1; end tracks = randint(1,1,[min,max]); fprintf('There are %d tracks on CD %d.\n', tracks, cdnum) cdnum = cdnum + 1;...
View Full Document

This note was uploaded on 07/19/2010 for the course EK 211 taught by Professor Attaway during the Spring '10 term at BU.

Ask a homework question - tutors are online