CE8_lab2

CE8_lab2 - CE-8 Lab 2: Basic MATLAB Use - Part 2Lab...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

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

Unformatted text preview: CE-8 Lab 2: Basic MATLAB Use - Part 2Lab Objectives (PLEASE BRING YOUR ROBOT AUTOMATIION BOOK TO LABS.) By the end of this lab you should be able to: 1.Identify what a variable is and how one is used in a program. 2.Create a program that properly uses IF, ELSE commands. 3.Use IF ELSE and FOR to give any condition and repetition to calculate multiple problems all at the same time.Variables You can use variables in expressions to set their values. Its important to remember when working with expressions that the right hand side of the expression is evaluated first. For example, if want our variable 'xyz' to be equal to 5 plus 3 we would simply write. xyz = 5+3 This statement first computes 5 plus 3 and then sets the variable 'xyz' to that value. We can also use variables in the right hand side equation, even if its the same variable as the one on the left hand side. For example: xyz = 5+3 xyz = xyz*2 What do you suppose the value of 'xyz' is? Lets look at these two commands in the way our robot will look at What do you suppose the value of 'xyz' is?...
View Full Document

Page1 / 3

CE8_lab2 - CE-8 Lab 2: Basic MATLAB Use - Part 2Lab...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online