Week_9_LGS_Functions

# Int randibig a random integer between 1 and num if

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s ‘Num' times. Int = randi(Big); % a random integer between 1 and Num if Int>Max Max = Int; elseif Int<Min Min = Int; end fprintf('%10.0f is integer number %.0f\n',Int,count) end fprintf('\n\nThe maximum integer is %.0f\n',Max) fprintf('The minimum integer is %.0f\n\n',Min) Note initialization requirements. Note if-elseif structure Engineering Engineering Education enter the maximum integer to enter the number of integers 910847 is integer number 3814639 is integer number 7346189 is integer number 2605422 is integer number 4479828 is integer number 1713129 is integer number 5750440 is integer number 1952580 is integer number 3872758 is integer number 5350958 is integer number be generated: 7654321 to generate: 10 1 2 3 4 5 6 7 8 9 10 The maximum integer is 7346189 The minimum integer is 1713129 What happened? Engineering Engineering Education clear;clc Max = 0; %initializing the smallest Max Big = input('enter the maximum integer to be generated: '); Min = Big; %initializing the largest Min Num = input('enter the number of integers to generate: '); for count=1:1:Num % go through t...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern