Saving Matrices In MatLab To Computer(Illustrated Expression)

Sometimes you need to save matrices in Matlab. For example you created a matrix according to datas that you are collecting in Matlab, what you need to do is save the data that you collected as a matrix file. You can load this saved matrix whenever you want into the Matlab. The extension of matrix is .mat. In this article we will show you how to save matrices that created in Matlab.

YOU CAN LEARN MatLab IN MECHANICAL BASE; Click And Start To Learn MatLab!

How To Save And Load A Matrix In Matlab?

Creating a matrix in Matlab.

For example we want to save the created matrix above as “Factors” to D: directory. Type “save D:\Factors” then press enter. This matrix will be saved to D: directory with the name of “Factors”.

Type save command in Matlab.

We wrote the save command for this matrix in Matlab then we pressed to Enter.

Saved matrix file in Matlab.

The Factors matrix file is saved as shown by red arrow above. You can open this by typing “load D:\Factors” then press enter to load it in Matlab.

Loaded matrix that saved before in Matlab.

As you can see, we typed “load D:\Factors” to command window in Matlab, then the related matrix is opened at Workspace that shown by red arrow above.

Saving and loading of a matrix in Matlab is simple like that.

Share This Post! Share Tweet Share

Write your comment on this topic.