0% found this document useful (0 votes)
31 views2 pages

Exam 1

The document outlines 6 homework problems involving matrix operations and data types in MATLAB, including comparing results of matrix multiplication and division, extracting submatrices from a data file containing ball trajectory measurements, and plotting the position versus time graphs of two trials of the experiment. Students are asked to perform calculations on integer matrices, extract portions of datasets, make new matrices, and create plots of the data.

Uploaded by

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

Exam 1

The document outlines 6 homework problems involving matrix operations and data types in MATLAB, including comparing results of matrix multiplication and division, extracting submatrices from a data file containing ball trajectory measurements, and plotting the position versus time graphs of two trials of the experiment. Students are asked to perform calculations on integer matrices, extract portions of datasets, make new matrices, and create plots of the data.

Uploaded by

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

Homework 1

Issued: 28.02.2019 Due:

*from MITx

i) Compare the results of A* B and A.* B . Explain what MATLAB did.


ii) Does A* B = B * A ? Explain.
iii) Does A. * B = B.* A ? Explain.

iv) Create matrix D = B−1 . What is B * D ?


v) Compare A / B and A \ B . Can you explain what is going on?
vi) Create a new 3×3 matrix E with all diagonal elements equal to 5 and other elements
equal to 0.

Problem 1.3 : Understanding data types


Use the matrixes you made in Problem 1.1.

i) What are the data types of the elements of matrixes A , B , and C ?


ii) How many bits of memory are required to store the information in matrix A ?
iii) Convert A and B to 8 bit signed integer matrixes and define them as matrix F and
G respectively (check out function int8( ) in the help menu).
iv) Calculate F + G and F *G . Explain results.

Problem 1.4 : Submatrix extraction and plotting


You are given the trajectory of a ball in a MATLAB file: ball.mat. (Please, download it from MIT
Server site.) The first column contains 100 time points and the second column contains the
corresponding 100 positions of the ball. The third and the fourth column contain a second trial of the
same experiment.

i) Extract the time data from column 1 and assign that to a new matrix “t”.
ii) Extract the position data from column 2 and assign that to a new matrix “x”.
iii) Plot “x” vs. “t”.
iv) Extract only the first 50 time points from column 3 and make a new matrix “t2”.
v) Extract only the first 50 positions from column 4 and make a new matrix “x2”.
vi) Plot “x2” vs. “t2”.
vii) Superimpose both trajectories. Plot them in different color.

You might also like