MATLAB is a language used by engineers and scientists for computational mathematics. It is used for developing algorithms, analyzing them, and also for creating models and applications. MATLAB also helps in developing applications using by deploying applications, embedded devices, and also interpreting using Simulink. To get started with MATLAB there are some basic commands required which are simple and very user-friendly.
Different MATLAB Commands:
Clear – This command removes variables from the memory
Exist – This command checks for the existence of a variable
Clc – This command clears the command window
Global – This command declares a variable as global
Help – If you need to search for any help just write the keyword at command window and it displays your available options
Who – This command lists the current variable
Type – This command displays the contents of a file.
Pwd – This command displays the current directory.
Date – This command displays the current date
What – This command lists all the Matlab files in the current directory
Matrices and vectors command
x(:) – This command selects all the elements of x
x(j:end) – This command selects jth to end element of x
x(j,:) – This command selects all j row elements
x(:,j) – This command selects all j column elements
diag(x) – This command selects the diagonal elements of x
Eye – This creates an identity matrix
Ones – This creates the array of ones
Zeros – This creates the array of zeros
Dot- This command generates the dot product of two matrices, note that the columns and rows of matrix decide the resulting matrix creation
Cross – Synonymously this creates the cross product, helpful in vector operations when represented in the matrix form
Rank – This command provides the result to an important mathematical parameter of matrices called rank which is the quantification of the lowest order of non-zero determinant carrying sub-matrix in the parent matrix
Det – Determinant of the matrix is calculated using this command.
Inv – Execution of this command provides us the inverse of a matrix.
edit file – This command opens the selected filename in the editor window
Alt – This command displays the hotkeys
Using Function keys:
F1 – This command helps for highlighting the selected function
F5 – This command runs the code
F9 – This command runs the highlighted code
F10 – runs code line
F12 – This command inserts a break point
Using Shift key:
Shift + F5 – This command leaves the debugger
Using Control Key:
Ctrl + R – This command helps in commenting a line
Ctrl + N – This command opens a new script
Ctrl + w – This command closes a script window
The following commands are enough for starting using MATLAB. Other than that, as its an easy language, it is very easy to understand and makes coding