M1.3. The MATLAB Workspace

We can view the variables currently in the Workspace by typing

» who
Your variables are:
ans       x         y         z
leaving 621420 bytes of memory free.

More detail about the size of the matrices can be obtained by typing whos.

We can find the size of a matrix or vector by typing

» [m,n]=size(x)
m =
     1
n =
     6

where m represents the number of rows and n represents the number of columns.

If we do not put place arguments for the rows and columns, we find

» size(x)
ans =
     1     6

Since x is a vector, we can also use the length command

» length(x)
ans =
     6

It should be noted that MATLAB is case sensitive with respect to variable names. An X matrix can coexist with an x matrix.

Sometimes it is desirable to clear all of the variables in a ...

Get Process Control: Modeling, Design, and Simulation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.