Week_7_LGS_Numerical_Manipulation

Output number as integer or real as appropriate

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e. Run it with pi. Screen grab code and results here. Output number as integer or real as appropriate. (Screen grab example…..) LECTURE Engineering Engineering Education Write a MATLAB script file (m-file) for this code. Run it with pi. LECTURE Engineering Engineering Education Exercise: Individual work: (8 minutes) Create a ‘multiplication game’ algorithm that allows the user to enter two integers then compare the user response (input of product) to the actual product. Output appropriate text for correct and incorrect. Sketch a flowchart on the next slide. LECTURE Engineering Engineering Education Engineering Engineering Education Convert this flowchart to MATLAB code. Paste here: LECTURE Engineering Engineering Education Engineering Engineering Education Exercise: Individual work: (5 minutes) The MATLAB ‘randi’ function will generate ramdom integers. Try typing: randi(20) You should get a random integer between 1 and 20. Modify your ‘game’: ask the user if they would prefer randomly selected...
View Full Document

This note was uploaded on 01/28/2014 for the course ENGE 1114 taught by Professor Twknott during the Spring '06 term at Virginia Tech.

Ask a homework question - tutors are online