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 Tutorial

Introduction of MATLAB In this MATLAB(stands for matrix laboratory) tutorial, we will cover core concepts of MATLAB and provide a solid foundation to enhance high computing skills. We are going to...

4 minutes read.

matlab polynomials

In mathematics, a polynomial is an articulation comprising of indeterminates factors and the respective coefficients, that includes just the tasks of augmentation, expansion, deduction, and non-negative whole number exponentiation of...

4 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.

matlab Integral

What is integration? In maths, Integral allots numbers to functions in a manner that portrays relocation, region, volume, and different ideas that emerge by consolidating tiny information. The way toward discovering...

5 minutes read.

Differentiation in Matlab

Differentiation in Mathematics In maths, Derivatives are an essential device of math or calculus. For instance, derivative of the situation of a moving article regarding time is the item's speed: this...

6 minutes read.

MATLAB Variables

What are variables? A variable is a storage location or a container to store or hold data. In programming, variables are used to reservedata created by the programmers so that it...

4 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 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 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 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 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 Algebra

Up until now, we have seen that every one of the models work in MATLAB just as its GNU, then again called Octave. In any case, for addressing fundamental mathematical...

6 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 Calculus

Analytics Calculus is significant in various fields like designing, physical science, and different sciences, yet the estimations are finished by machines or PCs, regardless of whether they are into Physics...

3 minutes read.

MATLAB Control Statements

What are control statements? The name itself suggests that something is being controlled, these control statements decide or alter the flow of execution ina program. In program, we often need to...

3 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 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 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 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 Graphic image

Matlab’s Graphic image Images are stored as arrays of numeric data in MATLAB® environment, so you can perform various sort of analysis on them to better visualize it. Picture Processing applications are given...

3 minutes read.