This action might not be possible to undo. Are you sure you want to continue?

MTH229 Using MATLAB as a Calculator Project 1– Exercises

NAME: SECTION: INSTRUCTOR:

Exercise 1: a. What is the output of the following commands: >> a=3; b=4; c=5; >> a + b/c (1) Circle one: 1. 3 4/5 2. 1.6 3. 3.8 4. 7/5

Exercise 2: a. Use assignment to help you compute 3− 32 − 2 · 3 . 2·3−2

(2) Answer:

Exercise 3: One of these things is not like the others. Which of these MATLAB commands is not like the other two? To help you out, try doing this with some values for a, b and c like http://www.math.csi.cuny.edu/matlab project 1 page 1

addition/subtraction Exercise 4: Repeat the same exercise with the following expressions. b=13. >> a * b ^ c 3.c) 2. (9) Circle one: 1. >> a * (b ^ c) 2.cuny. (6) Circle one: 1. c= 23. >> a . >> a * (b . >> (a * b) . >> a / b + c 2. >> (a ^ b) * c 3.“Using MATLAB as a Calculator” >> a= 3. (5) Circle one: 1. >> a * b .b) * c b. a. >> (a / b) + c d. (3) Circle one: 1. Which operations have higher precedence? (7) Circle one: 1. >> a + b / c e.csi.edu/matlab project 1 page 2 . >> a .(b * c) 3. >> (a .math.c 3. >> a / (b + c) 3. (4) Circle one: 1. multiplication/division 2.c c. >> a ^ (b * c) 2.b * c 2. >> a ^ b * c b. >> a + (b / c) 3. a. >> (a + b) / c 2. >> (a * b) ^ c http://www. (8) Circle one: 1.

exponentiation f. evaluate the following expression and rewrite it with parentheses showing the order in which MATLAB evaluates the operations. a + b + c = (a + b) + c and not a + (b + c).) In this example there are 4 operations. >> a ^ (b / c) e.edu/matlab project 1 page 3 . a. Enter both answers separated by a comma. Which operations have higher precedence? (12) Circle one: 1. 3 − 3 − 3 (14) Answer: b. >> 7 .csi. so your answer should have 3 pairs of parentheses. >> a / (b ^ c) d. 2^3^2 (16) Answer: http://www.3 ^ 2 / 9 + 4 (13) Answer: Exercise 5: Evaluate the following expressions ﬁrst using left-to-right order.math. multiplication/division 2. >> a ^ b / c 2.“Using MATLAB as a Calculator” c. >> a / b ^ c 2. and then from right-to-left. (11) Circle one: 1. (10) Circle one: 1. >> (a / b) ^ c 3.cuny. (For example. Using the rules you found. >> (a ^ b) / c 3. 6/3/2 (15) Answer: c.

does 5 − 3 − 2 = (5 − 3) − 2 or 5 − (3 − 2)?) >> >> >> >> 5 c 5 5 / / 7 a 7 7 + / * 8 b .c=8.edu/matlab project 1 page 4 . a(c−b) c−b (19) Answer: c. from left to right Exercise 7: Practice what you have just reviewed to evaluate the following. ab − c/b c−a (18) Answer: b. a. from right to left 2.csi. a − b(c − a) c−a (21) Answer: http://www.math.“Using MATLAB as a Calculator” Exercise 6: Investigate the expressions below to see the order in which the operations are performed by MATLAB. a3/2 b (20) Answer: d.b=5. Let >> a=4.cuny.c 8 8 * 9 What rule(s) does MATLAB use when evaluating expressions with two or more operations of the same priority? (17) Circle one: 1. from middle to end 3. (For example.

9] 2. 4. 3π/4 2. Evaluate arcsin(sin(3π/4)) (29) Circle one: 1. 3 in a vector named x. What is the output of x * x (31) Circle one: 1. a. 6] 3. An error b.csi. The vector [1. 2. 4.math.“Using MATLAB as a Calculator” Exercise 8: Use MATLAB to evaluate the following expressions. You will need to convert degrees to radians ﬁrst. (26) Answer: b. The vector [1. 9] 2. Answer the following for this vector. The vector [2. Evaluate sin2 65◦ (27) Answer: c. Evaluate e(10−8. An error http://www. −5π/4 3. 4.cuny. 6] 3. MATLAB uses radians for all angle measurements. π/4 Exercise 9: Store the number 1. a. The vector [2.5)/3 (28) Answer: d. Calculate the sine of 40 degrees using MATLAB.edu/matlab project 1 page 5 . 4. What is x+x? (30) Circle one: 1.

a. The odd numbers 1.1/2.4) http://www.1/2) 3.500 4..500 2.7) 4. What linspace command produces this output: 1. Make sure your answer is correct.30..4.000 (34) Circle one: 1.edu/matlab project 1 page 6 .cuny. The numbers 10.000 3.4) 2.500 3.csi. linspace(1.. linspace(1.3..math.000 2.000 1.120 (33) Answer: Exercise 11: a.20. linspace(1..4.“Using MATLAB as a Calculator” Exercise 10: Find MATLAB commands which generate the following lists.. linspace(1.7.99 (32) Answer: b.

X=-100:20:100. X=-100:10:100.pi) (35) Answer: Exercise 12: Two common measures of temperature are the Fahrenheit and the Centigrade scales. If two vectors are the same length. At what temperature is the Celsius and Fahrenheit measurement the same? (39) Answer: http://www. Which MATLAB commands give this? (38) Circle one: 1.cuny. X=-100:20:100. and Y be the corresponding Celsius values.edu/matlab project 1 page 7 . Find room temperature in Celsius (F = 68◦ ) (36) Answer: b. The syntax is either [X.6◦ ) (37) Answer: c.“Using MATLAB as a Calculator” b. X=-100:10:100. a. Look carefully at the table of X and Y values.Y]’.math. What is the last value output by the command >> linspace(0. Let X be a vector of Fahrenheit values between -100 and 100 in step size of 20. Y=9/5*X+32 2. Find the average body temperature in Celsius (F = 98.csi. a table can be made from them that allows you to compare their entries.Y] or [X. Y=9/5*x+32 3. Y=5/9*(X-32) d. Y=5/9*(X-32) 4.

Sign up to vote on this title

UsefulNot useful- Dot Net-knowledge and Data Engineering -- Optimizing the Calculation of Conditional Probability Tables in Hybrid Bayesian Networks Using Binary Factorizationby ncctstudentproject
- Management Science May2006 Rr221701by Nizam Institute of Engineering and Technology Library
- ile[1]by api-3851615
- Static and Dynamic Verification of Finite-State Propertiesby Patrick Lam

- A Rapid Prototyping Environment for Wireless Communication
- matlab
- FCCPS Facilities Master Plan
- Expressions and Operators
- 20 Slide
- R_GL Manual Account Clearing
- 3.1.Functional Dependency
- Install ATC Creo Pro 5.0
- Java Basic Operators-2
- Teste DELPHI
- GATE-CS 2003
- B.C.A.(Upto2002) (1)
- 20 Slide Recurs Ion
- CS2308-LM(2)
- GATE- Computer Science(CS)- 2003
- Groupware
- BS Lab_Demo
- Java 5
- SBI-po
- Normlaization Gate Questions
- Dot Net-knowledge and Data Engineering -- Optimizing the Calculation of Conditional Probability Tables in Hybrid Bayesian Networks Using Binary Factorization
- Management Science May2006 Rr221701
- ile[1]
- Static and Dynamic Verification of Finite-State Properties
- MIT6_088IAP10_lec03
- B ILE Labs
- MATLAB Tutorial
- Prepking 000-041 Exam Questions
- PortAudio Readme
- Readme
- Using Matlab as Alculator

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue reading from where you left off, or restart the preview.

scribd