0% found this document useful (0 votes)
43 views3 pages

Exercise With Answers

This document contains instructions for exercises involving vectors, matrices, and basic operations in MATLAB. It includes: 1) creating and saving row and column vectors to a file, 2) verifying a trigonometric identity, 3) indexing and reversing a vector and extracting every second element, and 4) reversing rows and columns of a matrix, extracting subsets of rows and columns, and removing columns from a matrix.

Uploaded by

arunvinodh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views3 pages

Exercise With Answers

This document contains instructions for exercises involving vectors, matrices, and basic operations in MATLAB. It includes: 1) creating and saving row and column vectors to a file, 2) verifying a trigonometric identity, 3) indexing and reversing a vector and extracting every second element, and 4) reversing rows and columns of a matrix, extracting subsets of rows and columns, and removing columns from a matrix.

Uploaded by

arunvinodh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Exercises

I. Do the following 5 things:

Create the variable r as a row vector with values 1 4 7 10 13

Create the variable c as a column vector with values 13 10 7 4 1

Save these two variables to file varEx Clear the workspace

Load the two variables you just create

II. Verify
e^(i*x) = cos(x) + i*sin(x) Note: x=pi/3

III. Indexing - Consider the following column vector:

a. Check the following code in the


command window

b. Do the following for the vector x


Reverse the array

Reverse the array


Extract every second element

IV. Generate the following matrix


variable A

with

Do the following

Reverse the rows and columns


of A matrix

Get only the 1st and 3rd rows


and the 2nd and 4th columns of
A matrix

Remove the 2nd and 4th


columns of A matrix

You might also like