Week_7_LGS_Numerical_Manipulation

moral be careful when comparing real numbers they

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: kspace?? Moral: be careful when comparing real numbers. They may be algebraically equal, but binary conversion (or LECTURE Engineering Engineering truncation) may change that. Education Questions: ink on this slide 1. What character suppresses the output of an assignment statement? 2. What character will cause MATLAB to ignore the rest of that line of code? 3. What would fprintf(‘VT%7.3f’,pi) produce/output? 4. What shape represents a decision structure? 5. How many outs in an inning of baseball? 6. How many billionaires in the world? (b..b…billion) FYI……some MATLAB intrinsic (built in) functions: •Trig functions such as sin, sind, atan, atand •exp •log •log10 •sqrt •pi •randi •round To avoid conflict, use capital letters in your variables! LECTURE Engineering Engineering Education Enter the following at the command prompt and check the result: >> num=input(‘enter a number please: ‘,’s’); Respond with the number 9 as input, then type: >> fprintf(‘\n the number is %.0f’, num); What is the response? Why? LECTURE Engineering Engineering Education Engineering Engineering Education Exercise: Individual work: (3 minutes) Write a mathematical or algebraic algorithm (NOT...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online