ITEC 2600 Study Guide - Quiz Guide: Row And Column Vectors, Matlab, Exclusive OrExam
Course CodeITEC 2600
This preview shows half of the first page. to view the full 3 pages of the document.
ITEC2600 in-Class Exercises X.Zhou York University
Introduction to Analytical Programming
Lab Exercise ♯1
1. Explain what the following MATLAB commands produce, then excute the following expressions in
MATLAB command window.
(a) (3 ∗4) ∧2
(c) y= 10 ∧5
(d) x= 5
2. Deﬁne variables a, b, c and das a= 15, b = 4, c = (3 ×a)/b, and d=a×b×c
b+c, then evaluate the
followings in MATLAB command window. (Note: the followings are mathematical expressions).
d×log2(a)−cos(d×c) + ab
3. Think about what results would be of the following expressions, and then type them in MATLAB to
verify your answers.
3 == 5 + 2
(10 >5) + 2
'c'== 'd'- 1 && 2 <4
'c'== 'd'- 1 || 2>4
xor('c'== 'd'- 1, 2 >4)
xor('c'== 'd'- 1, 2 <4)
4. Create a row vector vec start from -10 to 10, by incremental 5, using colon operator. The do the
(a) Create a new vector sub vec by extract the last 3 elements of vector vec.
(b) Change the value of last element of vec such that the value of last element is the function sin of
You're Reading a Preview
Unlock to view full version