Where: Look in the Matlab Primer for Any of This Information

Where: Look in the Matlab Primer for Any of This Information

<p> Leader: James MATLAB If Statements Course: ChE 160 Supplemental Instruction Instructor: Heinen/ Stiehl/ Brenza Iowa State University</p><p>Where: Look in the Matlab primer for any of this information</p><p>Discussion The first element when understanding how to program. If statements are used so extensively, that mastering them early will save you an incredible amount of headache.</p><p>Concept Questions How do you end an If statement? What is the difference between Else and Elseif?</p><p>Review For the following: What is the value for z when input = 18? What are the values for a, b and c? What is the value for z when input = 190? a=2; b = 22; c = 199; if a < 4 z = input('Enter a number: '); c=17; if z == 40 elseif b~=c z=z*4 c=26 elseif z < 20 end z=z/3 else z=176 end What is the value for z when: z=4? z=60? What are the errors in this code? z= 120? j = 16; k = 44e-6; z = InputBox ("Enter a number") if k = 4 If z > 110 Then j = 16 z = z - 4 else q ~= 4 ElseIf z < 40 Then j = 2 z = z * 6 else k => 16 Else j =1 z = 176 end End If</p><p>Exam Prep Just screw around with the IF statements. The best way to understand is to just try using them over and over again.</p><p>1060 Hixson-Lied Student Success Center v 515-294-6624 v [email protected] v http://www.si.iastate.edu</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us