Visualization of subspaces

1.7k Views Asked by At

Are there any ways in MATLAB or MuPAD to visualize the nullspace and range for the given vector space?

1

There are 1 best solutions below

0
On

Here I just say how to do it with Maple for other softwares maybe one other will tell you, also for Mathematica you can ask the Mathematica section of stackexchange.

As an example I'll compute the NullSpace of the following matrix; $$\begin{bmatrix}1 & 1 & 1\\ 0 & 2 & -1\\ 2 & 0 & 3\end{bmatrix}$$

with(LinearAlgebra):
M := Matrix([[1, 1, 1], [0, 2, -1], [2, 0, 3]]):
L:= NullSpace(M);

You should call the LinearAlgebra package for using matrixes and the command NullSpace, and for calling a package we do it with with(...) and in ... you should write name of the package. The ":" sign is for when you don't want to see the output and ";" sign for when you want to see the output. So when you finished writing a command, you use one of these two signs and then press Enter from keyboard. Then you should give the matrix to Maple. You can define a matrix as I did, writing its rows. You can do it using with columns in another way as following.

M:=<<1,0,2>|<1,2,0>|<1,-1,3>>:

And finally you using NullSpace(...) you will see a basis for the Null space of your matrix. You could do it in one step if you are not going to use your matrix again and again in the sequel.

NullSpace(Matrix([[1, 1, 1], [0, 2, -1], [2, 0, 3]]));

For plotting you can use the two following ways.

plot3d([-(3/2)*t, (1/2)*t, t], t = -5 .. 0, s = 0 .. 5);

enter image description here

X := <x, y, z>:
f := M.X:
with(plots):
implicitplot3d([f[1] = 0, f[2] = 0, f[3] = 0], x = -5 .. 5, y = -5 .. 5, z = -5 .. 5);

enter image description here

The null space of $M$ is the line in the first figure which is the intersection of the three planes in the second figure.