Introduction to Matlab- In this article, we will learn a basic introduction to MATLAB and the software we will be using. MATLAB actually stands for MATRIX LABORATORY. It was built in 70s for the manipulation of Matrices. MATLAB is a scripting language where, backend programming is done in other languages like C, C++, and Java. MATLAB is a big programming environment which is used for the simulation and other research in Engineering, Computer Science, Image Processing, and other fields. As the MATLAB was built for matrices, so it is a very good tool for the manipulation of matrices. MATLAB has excellent visualization capabilities where the output can be seen in multiple dimensions as well. MATLAB has a lot of built-in functions which can be used to write a code in a very simple way. MATLAB is very easy to learn and very simple to use.
How to install MATLAB:
In order to use MATLB, first of all, you need to download MATLAB.
It will be in the form of a rar file. The first step is to extract this rar file by using winrar, right click and click extract to the folder as the size is very large approximately 20 gb so it will take some time.
After the folder has been completely extracted, now you can open the folder and start the MATLAB installation. Before running setup, you have to go to the download folder and open the readme file and from this readme file copy the installation key because this will be needed during the installation also.
Before running setup turn off your wi-fi and also turn off anti-virus or windows 10 bit defender.
Go to manage settings and turn off real time protection press yes so that’s all your antivirus protection is turned off.
Now double click the setup file to start installation in the first window accept the license agreement press next
Now enter the file installation key that you had copied from the readme file press next
In the next step you have to select the license file so you have to browse to the folder my folder is placed on the desktop from here and select the license underscore standalone then press next
In the next step we will select the destination folder where we want to save the MATLAB
In the next step you can select the products that you want to install. There are a number of products if you select all these products the size of the MATLAB will be approximately 30 to 35 GB. So depending upon your available size and use you have to select either all the products or select products that you really need. I am going to install all the products so I will press next
Here you can add a shortcut to desktop it is optional i am going to check it then press next and from here now the installation will be started. Now it make take several minutes or hours depending on the speed of your system or pc.
Now once the installation is completed then click on the close button. Now you have to do two things before starting Matlab, go to the downloaded folder and open the Crack folder and copy the license file stand alone. Now go to the installation directory go to “C” drive program file share you will see a folder named polyspace inside this folder go to the version 2020. Here you will see a folder named licenses open this folder and paste the license file here. Now the second thing is again go to the downloaded folder and open R2020a folder in which another folder bin will open. In bin folder open the win64 folder. In win64 folder open matlab startup folder. In matlab startup there will be dll file with the name “lmrimpl” copy this dll file and now again go to the installation directory “C” by traversing the same folders go to bin from here then win64 from here matlab startup plugins. Now paste the dll file in the startup plugins and replace it and then press continue.
Now we are done with the MATLAB installation and the activation thing which took a few minutes. Now it’s ready for the use. All you need find the MATLAB ICON double click on it and it is ready to use. You will see Matlab 2020a in action. Congrats, you just did it. Now we will explain the Matlab Interfaces, to help you easily get started with the very basic things.
The MATLAB interface can be divided in to 5 major parts.
The left most part which is shown as current directory, all the files in the code are accessed through this directory.
The next part is command window where single line commands can be run and the output can be seen in it. Lengthy codes can be written in editor and saved to be used later on. All the variables which are being used in command window and editor are being shown in workspace with their properties.
Command history Panel:
All the commands which are used recently are listed in command history panel.
The basic role of the workspace is that whatever variable you are assigning that variables will appear in this workspace. Let me show it to you
if I am assigning a variable x with value 45 then this x variable will be stored in the workspace. If I am assigning y = 78 the value 78 will be stored in y and that will appear in workspace. So whatever variable you are assigning in your script file or through your command window that variable will appear in MATLAB workspace. You can use this arrow button which is next to the Workspace to maximize and minimize the window.
Now let me show you something else let’s just restore now let’s understand this thing you have created these two variables for example if you are created another variable with some equations. We are going to use simple equations initially z is equal to x plus y and the value of z variable also is stored in workspace for example in future you want to carry on your program from this stage to carry on the program from this stage you require all these variables but once you exit this matlab all the variables from workspace will vanish it will be removed from workspace.
So if you want to use these variables for future use also what you can do you can save this workspace data and for that you need to click on save workspace a separate window to save the file will pop up you select a folder where you want to save it. I will name this testing we are testing this thing right so I am giving the name testing so we have saved right. So whatever data we have assigned in workspace. We have saved this data as testing name.
Now, i am going to give you a small command to exit the Matlab, just write exit and press enter the MATLAB will close.
I did it on purpose, why I restarted the MATLAB I will explain this right now, So we have again started MATLAB right now, if you remember previously we used three variables x, y, and z. Let’s try to access these values. So, let me write x it is undefined function and variable because the value of x you cannot see in workspace. So whenever you exit the matlab whatever values stored in workspace that will be automatically removed from workspace it will vanish. So let’s just try for y as well as for z so each of these variables is not assigned.
Now what we will do. Now we will import the data so we will click on import data a separate window will pop up. Now we will import the data from the workspace folder testing is our file.
We will open it so select variable to import using checkbox whichever variables we want to import we can import either them separately or all for example if i want to only import z then I will click z only or else if i want to import all of them then I will click mark on everything just click on finish and now you can see all these variables are assigned over here.
So all the variables are recall in this workspace and now if you say x then it will show the value of x if you say y it will show y and if you say z it will show z so this is interesting thing about workspace and this is how you can store your data in workspace.
Now let’s see something else just maximize this workspace the shortcut key to maximize and minimize this workspace is ctrl shift m. There are still different values which are available which you can see for these variables in this workspace.
There are still many thing which you can observe in this workspace other than name value and size of the variable just go to this line right click and all these types of data you can see for those files bytes class minimum value, maximum value range mean all these things you can see for the variable you are assigning.
Let’s just minimize it and assign a new matrix or new variable a is equal to [1 2 3]. Now you can see value is [1 2 3] size is 1 cross 3 the size of this variable is 24 byte double minimum value in this variable is 1 and maximum value in this variable is 3 range 2 mean value is 2. So you can see all this important information in this workspace about your variable so this is the brief about workspace.