Unformatted text preview: '18' ; %Second student age. student(2).major= 'Electrical and Computer Engineering' ; %Second student major. for x=1:2 fprintf( '%s is %s years of age and is studying %s.\n' ,student(x).name,student( x end Jack is 18 years of age and is studying Computer Science. Jill is 18 years of age and is studying Electrical and Computer Engineering. Problem 3 x=10000000; %This is the smallest 8 digit prime number, the starting point. while (~isprime(x)) %Loop till you find the smallest 8 digit prime number. x=x+1; %Increases x by one until you find the smallest 8 digit prime number. end fprintf( 'The smallest 8 digit prime number is %.0f. \n' ,x) %Displays the smallest 8 The smallest 8 digit prime number is 10000019. Published with MATLAB® 7.10 1...
View
Full Document
 Spring '08
 Madey
 Physics, Electrical Engineering, Current, ........., Vishal Patel, datestr

Click to edit the document details