matlabex1

2
Matlab Basics: Exercise 1 1.) Set x = 4, y = 12, z = -2 and find the following (a) y/x*z (b) y/(x*z) Are these different? Why or why not? 2.) Find the square root of x, y, and z above using the built in matlab function. Print you answer in format long and then again in format short e. 3.) Evaluate the following using matlab: Anything interesting happen? 4.) Create the following row vector two different ways. 5.) Make a column vector b that is the transpose of a two different ways. 6.) Create a vector c that is the same as a but whose second component is the last component of b. 7.) Create a 4x4 array . 8.) What is A’? 9.) Set a column vector d equal to the first row of A using ‘:’ notation and set a vector e equal to the first row of A using the column notation. 10.) Create a vector, u, of 15 equally spaced points between and

Upload: yared4

Post on 15-Jan-2016

212 views

Category:

Documents


0 download

DESCRIPTION

basic matlab

TRANSCRIPT

Page 1: MATLABex1

Matlab Basics: Exercise 1

1.) Set x = 4, y = 12, z = -2 and find the following (a) y/x*z (b) y/(x*z) Are these different? Why or why not?

2.) Find the square root of x, y, and z above using the built in matlab function.Print you answer in format long and then again in format short e.

3.) Evaluate the following using matlab:

Anything interesting happen?

4.) Create the following row vector two different ways.

5.) Make a column vector b that is the transpose of a two different ways.

6.) Create a vector c that is the same as a but whose second component is the last component of b.

7.) Create a 4x4 array .

8.) What is A’?

9.) Set a column vector d equal to the first row of A using ‘:’ notation and set a vector e equal to the first row of A using the column notation.

10.) Create a vector, u, of 15 equally spaced points between and

11.) Make a table whose first column is u, and the second and third columns are .

12.) Swap the first and second column of your table using the : notation

13.) Create a vector v column vector that is the same as the 4-12 rows of the third column in your table.