Signals and Systems - Electrical Engineering

(avery) #1

34 C H A P T E R 0: From the Ground Up!


The results of these operations are not given because of the semicolons at the end of the commands.
The following script could be used to display them:
disp(’ Ax = b’) % MATLAB function that displays the text in ’ ’
A
b
x
t

which gives
Ax = b
A =
1 0 0
2 2 0
3 3 3
b =
2
2
2
x =
2.0000
−1.0000
−0.3333
t =
6

Another way to solve this set of equations is
x = b’/A’

Try it!

MATLAB provides a fast way to obtain certain vectors/matrices; for instance,
% special vectors and matrices
x = ones(1, 10) % row of ten 1s
x =
1 1 1 1 1 1 1 1 1 1
A = ones(5, 5) % matrix of 5 x 5 1s
A =
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
x1 = [x zeros(1, 5)] % vector with previous x and 5 0s
Free download pdf