MATH/CMSC 206 - Introduction to Matlab

Announcements Syllabus Tutorial Projects Submitting

Answers to Self-Test

1. When we get to the pgroamming section we'll be able to do this in a really fancy way but that was not the intent here. In this case we simply do:

A=[2^-2,2^-5,2^-8;2^-1,2^-4,2^-7;2^0,2^-3,2^-6;2^1,2^-2,2^-5]
A =

    0.2500    0.0312    0.0039
    0.5000    0.0625    0.0078
    1.0000    0.1250    0.0156
    2.0000    0.2500    0.0312

2. This can be done either by predefining the matrices or not doing so. If we choose to then we have:

syms t;
A=[1 t -t;2 t^2 1/t];
B=[t 1/t^2;t 2;-1 0];
A*B
 
ans =
 
[       t^2 + 2*t,   2*t + 1/t^2]
[ 2*t - 1/t + t^3, 2/t^2 + 2*t^2]
 

whereas if we choose not to then we have:

syms t;
[1 t -t;2 t^2 1/t]*[t 1/t^2;t 2;-1 0]
 
ans =
 
[       t^2 + 2*t,   2*t + 1/t^2]
[ 2*t - 1/t + t^3, 2/t^2 + 2*t^2]