MATLAB Commands

MATLAB Commands

MATLAB (stands for matrix laboratory) is a high-level programming environment for scientific calculation, and it provides functions more efficiently than other programming languages. In addition, it has many in-build modules and integration with Simulink, which helps in complex computation.

MATLAB commands are very helpful to users to establish connection with the application. Using a command-line interface, the user can interact with the software using MATLAB's various commands.

The primary purpose of MATLAB commands is to work with the system like import/export data, loading files to carry out the application functions.

It provides various commands to serve different purposes; for example, to clear the screen, we use the command ">>clear."

Let us look into some basic MATLAB commands

COMMANDSPURPOSE
clearIt clears variables from the memory
whatMATLAB files are listed in the current directory
pwdCurrent directory is displayed
dateCurrent date is displayed
helpJust type this command at command window if you want any kind of guide or help
whoThis command helps to list the current variable
typeContent of a file is displayed
existExistence of a variable is checked with the help of this command
clcCommand window gets cleared
globalA variable is declared as global by using this command
dispContent of array or string is displayed  
fscanfFormatted data from a file is read.
inputTo prompt for input
formatScreen-display format
fprintfWrites formatted files to screen or file
;Screen printing
quitExits from MATLAB
lookforTo help entries for keyword

Let us execute some of the above-mentioned commands.

Commands like ‘whos’, ‘date’, ‘what’ are executed.
MATLAB Commands
Commands like ‘pwd’, ‘help’, ‘disp’, ‘who’ are executed.
MATLAB Commands

Now let us look into some intermediate and advance MATALB commands

Commands related to files and directory information

dirContents of current directory are listed out.
rmdirTo remove a directory
mkdirTo create new directory
cdTo change directory
copyfileTo copy a file
editpathSearch path changes
IsCurrent file contents are listed
pathMATLAB search path (sets or gets)
deleteTo Delete file
diaryTo save the text generated in MATLAB session
!Thiscommand provide access to Operating system.
wklreadThis command read .wk1 spreadsheet file.

Any kind of help regarding the user manual or procedure to check out any features of the software can be fetched with the help of these on-line commands.

helpTo provide basic help info
helpdeskBrowser based help is provided
demoTo run demo program
docWeb HTML documentation
infoMATLAB information is displayed
whatsnewReadMe files are displayed
echoScript file echo command
homeTo send cursor home

Let us execute some of the above-mentioned commands.

Commands like ‘helpdesk’, ‘demo’, ‘doc’ are executed.
MATLAB Commands
MATLAB Commands
MATLAB Commands

Commands for general use

General use in the sense to fetch basic information of our computer like date and time or type of computer we use. Let us look few of them mentioned below.

computerReturns which type of computer your using
clockVector format of clock time and data
morePaged output is controlled
verLicense and version of MATLAB data is displayed
benchTo provides benchmarks
^c(Control-c)To locally abort
startupTo execute M-file
ticTo start stopwatch
tocTo read the time of stopwatch
etimeTo find elapsed time function
cputimeTo find elapsed CPU time
matlabarcMaster start-up file

Let us execute some of the above-mentioned commands.

Commands like ‘computer’, ‘clock’, ‘ver’, ‘bench’, ‘tic’, ‘tac’, ‘cputime’ are executed.
MATLAB Commands
Commands ‘ver’ and ‘bench’ are executed.
MATLAB Commands
Commands  ‘tic’, ‘tac’, ‘cputime’ are executed.
MATLAB Commands

Commands on mathematical computations

Here are few MATLAB commands which are especially programmed for carrying out various mathematical computations like array manipulation, solving linear algebra, integration, polynomial, calculus, elementary math, etc.

Commands for Matrix arithmetic
eyeAn identity matrix is created
onesArray of ones is created
zerosArray of zeros is created
dotTo generate Dot product of two matrices
crossTo generate cross product of two matrices
Commands for array operations
catTo concatenate two arrays
lengthTo calculate no. of elements in the array
minMinimum value of array is returned
maxMaximum value of array is returned
Commands for matrix for linear equations
rankReturns the rank of a matrix
detDeterminant of the matrix is returned
inv  To return inverse of a matrix.
Commands for polynomial
poly2sym(vector)This helps to convert vector to symbolic polynomial.
poly2sym(vector,’v’)This is also similar to poly2sym(vector).
Commands for strings
findstrTo find start index in a given string.
strcmp  To compare two given strings, returns 1 if match is found or else it returns 0.
linsolve()To solve linear expressions.
contour()To solve linear expressions.

.


Related Topics

MATLAB Data types

What is Data Type? A data type is a classification that helps to decide what class of value a variable can reserve in programming. And also, what sort of operations can...

6 minutes read.

MATLAB’s Array

What is an Array? An array is a collection of similar datatype elements in contiguous memory location. Every element in array is stored with an index number starting from 0. First...

4 minutes read.

Matlab Matrix

Matlab Matrix What is a Matrix? a rectangular array of expressions arranged in particular rows and columns that is treated as a solitary substance and controlled by specific standards. MatlabMatrix A Framework called matrix,...

5 minutes read.

Matlab Unit impulse signal generation

What is the Necessity of learning Matlab programs? Matlab Programming Examples give you an idea of typical Matlab programs in a nutshell.Matlab programming should be utilizing object-oriented programming, GUI programming, and...

3 minutes read.

MATLAB Commands

MATLAB Commands MATLAB (stands for matrix laboratory) is a high-level programming environment for scientific calculation, and it provides functions more efficiently than other programming languages. In addition, it has many in-build...

3 minutes read.

MATLAB Scripts

Scripts Introduction Matlab Script represents some programs and is executed like we execute command in the command window of Matlab’s environment. Matlab script is also defined as a sequence of commands;...

6 minutes read.

MATLAB Features

MATLAB Features MATLAB (abbreviation for matrix laboratory) is an interactive programming environment that eases high-power computations in the IT world. Initially, it was developed with the intention of matrix calculation only....

4 minutes read.

MATLAB Gaussian Pulse

Gaussian pulse shape description: The diagram of a Gaussian is a trademark symmetric "ringer bend" shape. The boundary an is the stature of the bend's pinnacle, b is the situation of...

3 minutes read.

MATLAB Vector

Introduction to MATLAB vector Vectors are one of the representations of arrays. It tends to be addressed in two different ways line(row) vector and section(column) vector. A vector is defined as...

5 minutes read.

MATLAB Linear Convolution problem solving

What is linear convolution? In science (specifically, useful examination), convolution is a numerical procedure on two capacities (f1 and g1) that communicates how the state of one is adjusted by the...

4 minutes read.

MATLAB Program - To Solve Differential Equation Using Euler’s Method

Using Euler's method to solve differential equation Can you imagine a point where we do not use differential equation to solve differential condition? Truth be told, there are a few different...

3 minutes read.

MATLAB vs Other Languages

MATLAB vs Other Languages If we try to find which is the best computer programming languages, the answer is not straightforward, and that might sound similar to asking which is the...

3 minutes read.

MATLAB Loops

Loops in programming Concept of looping is used to execute instructions repeatedly. It helps coders to reduce lines of code by setting a condition. In looping first a condition is fixed,...

3 minutes read.

Matlab Simulink

What is Simulink? Simulink is a re-enactment and model-based plan climate for dynamic and installed frameworks, incorporated with MATLAB. Simulink, additionally created by "MathWorks", is an information stream graphical programming language apparatus...

7 minutes read.

MATLAB special graphic function

In this section, we portray a greater amount of MATLAB's illustrations graphic functions and the most well-known methods of controlling and redoing graphics. Let’s type help designs, help graph2d (for...

7 minutes read.

MATLAB Operators

What is an Operator? A specific operation is performed by using a symbol which is called an operator. Example: A+B, where A, B are called operand and '+' is called operator. If you...

8 minutes read.

Matlab Square Wave Signal Generation

What is Square Wave signal Generator? A “square wave” is a sort of non-sinusoidal waveform, most normally experienced in gadgets and sign preparing. An optimal square wave substitutes consistently and momentarily...

3 minutes read.

MATLAB Setup And Environment

MATLAB Setup And Environment MATLAB System Requirements As we have already discussed the prerequisite to begin the learning journey of MATLAB now let us drive into some technical system requirements. RAMàMinimum 4GB or...

3 minutes read.

MATLAB Butterworth filter

What is Butterworth filter? The Butterworth channel is a kind of sign preparing channel intended to have a recurrence reaction as level as conceivable in the passband. It is likewise alluded...

3 minutes read.

MATLAB Transform

MATLAB furnishes for working with changes, for example, the Laplace and Fourier changes. Changes are utilized in science and designing as an instrument for improving on investigation and take a...

5 minutes read.