Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

What is matlab?

MATLAB is a computer programming language that uses computations and algorithms to analyze large amounts of data and present it in visually
appealing formats. Some features of matlab include:

● computation of numeric data


● creating graphics for scientific use
● modeling and simulating data
● analyzing data

Matlab is a software system that has many components. Let's go over some of them here.
MATLAB Environment
The matlab environment is the way the program presents itself and the tools available. The matlab environment allows you to run commands,
manage your files, and even analyze data. It has a command window where you can write simple commands. The command window can be
thought of as similar to a high performing calculator. For example, you can type in a formula (5+2)*3 and click the Execute button and matlab
assignment help will display the result.

The MATLAB work environment provides tools that allow you to run and debug programs, install add-ons, change fonts and displays, and
has functions that you can call to perform common tasks. For example, if you have the coordinate points x and y, you can use the matlab plot
function to create a graph using the values of x and y.
MATLAB Programming Language
The matlab programming language is simpler than most programming languages and easier to learn. It is known as a high-level language
because it is closer to the human language than the computer or machine language.

● The semi-colon in matlab indicates the end of statement. It can also be used to stop a statement from executing. For example, if you
type in x=5+3 without the semicolon and click the Execute button, MATLAB ASSIGNMENT HELP will display the result as x=8. If
you type in x=5+3; with the semicolon, and click Execute, MATLAB will not display the result of the computation.
● The % sign is used to indicate that the text following is a comment and not to be interpreted by matlab. Programmers use comments
to provide explanations about the code they are writing. For example, in MATLAB you can write a=b+5 and the use the % sign to
explain that 'a' is the length of a room and 'b' is the width.
● Variable names in matlab are case sensitive. For example, if you create a variable 'TempEveryHour' to represent the temperatures
every hour, and need it to use this variable in a mathematical formula, you would need to call the variable by its exact same name:
TempEveryHour and not TemperatureEveryHour or tempeveryhour.
History
Cleve moler, the chairman of the computer science department at the University of New Mexico, started developing matlab
in the late 1970s. He designed it to give his students access to LINPACK and EISPACK without them having to learn
Fortran. It soon spread to other universities and found a strong audience within the applied mathematics community. Jack
Little, an engineer, was exposed to it during a visit Moler made to Stanford University in 1983. Recognizing its commercial
potential, he joined with Moler and Steve Bangert. They rewrote matlab in C and founded MathWorks in 1984 to continue its
development. These rewritten libraries were known as JACKPAC.In 2000, matlab was rewritten to use a newer set of
libraries for matrix manipulation, LAPACK.

matlab was first adopted by researchers and practitioners in control engineering, Little's specialty, but quickly spread to
many other domains. It is now also used in education, in particular the teaching of linear algebra and numerical analysis,
and is popular amongst scientists involved in image processing.
Syntax
Matlab environment behaves like a super-complex calculator. You can enter commands at the >> command prompt.

matlab is an interpreted environment. In other words, you give a command and MATLAB executes it right away.

Hands on Practice
Type a valid expression, for example,

5 + 5

And press ENTER

When you click the Execute button, or type Ctrl+E, matlab executes it immediately and the result returned is −
ans = 10
Let us take up few more examples −

3 ^ 2 % 3 raised to the power of 2

When you click the Execute button, or type Ctrl+E, MATLAB ASSIGNMENT HELP executes it immediately and the result returned is −
ans = 9

Another example,

sin(pi /2) % sine of angle 90o

When you click the Execute button, or type Ctrl+E, matlab executes it immediately and the result returned is −
ans = 1
Use of Semicolon (;) in MATLAB
Semicolon (;) indicates end of statement. However, if you want to suppress and hide the matlab output for an expression, add a
semicolon after the expression.

For example,

x = 3;

y = x + 5

When you click the Execute button, or type Ctrl+E, matlab executes it immediately and the result returned is −
y = 8

Adding Comments
The percent symbol (%) is used for indicating a comment line. For example,
x = 9 % assign the value 9 to x

You can also write a block of comments using the block comment operators % { and % }.

The matlab editor includes tools and context menu items to help you add, remove, or change the format of comments.
Matlab operators
an operator is a symbol in computer programming and mathematics which is used to perform specific mathematical or logical

operations or you can also define it as a character that represents an action for example ‘+’ is a character that represents addition

similarly Boolean operators are used to working with true/false values.

One more important fact to keep in mind is operators in matlab work for both scalar and non-scalar.

.
Matlab offers the following type of operators:

● Arithmetic operators

● Relational operators

● Logical operators

● Bitwise operators

● Set operators
Matlab use for
MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming
in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses
include: Math and computation.

● Embedded Systems
● Control systems
● Digital signal processing
● Wireless communications
● Robotics
● Data Analytics
● Deep Learning
● Motor and power control
● Image processing and computer vision

● Internet of Things
Matlab program
Write your first MATLAB ASSIGNMENT HELP program

a = 3; b = 5;

c = a+b

Output: 8

Remarks: (1) The semicolon at the end of a statement acts to suppress output (to keep the program running in a "quiet
mode"). (2) The third statement, c = a+b, is not followed by a semicolon so the content of the variable c is "dumped" as the
output.
Features of MATLAB
● It is a high-level language for numerical computation, visualization and application development.
● It also provides an interactive environment for iterative exploration, design and problem solving.
● It provides vast library of mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, numerical
integration and solving ordinary differential equations.
● It provides built-in graphics for visualizing data and tools for creating custom plots. MATLAB's programming interface gives
development tools for improving code quality, maintainability, and maximizing performance.
● It provides tools for building applications with custom graphical interfaces.
● It provides functions for integrating MATLAB ASSIGNMENT HELP based algorithms with external applications and languages
such as C, Java, .NET and Microsoft Excel.
Naming Variables
Variable names consist of a letter followed by any number of letters, digits or underscore.

MATLAB is case-sensitive. Variable names can be of any length, however, matlab uses only first N characters, where N is
given by the function namelengthmax.

Saving Your Work

The save command is used for saving all the variables in the workspace, as a file with .mat extension, in the current
directory. For example, save myfile You can reload the file anytime later using the load command. load myfile.
Data type
Matlab does not require any type declaration or dimension statements. Whenever matlab encounters a new variable name, it creates the variable
and allocates appropriate memory space. If the variable already exists, then matlab the original content with new content and allocates new storage
space, where necessary.

MATLAB provides 15 fundamental data types. Every data type stores data that is in the form of a matrix or array. The size of this matrix or array is a
minimum of 0-by-0 and this can grow up to a matrix or array of any size. The following table shows the most commonly used data types in matlab:
Data Type Description

int8 =8-bit signed integer

uint8= 8-bit unsigned integer

int16= 16-bit signed integer

uint16= 16-bit unsigned integer

int32 =32-bit signed integer

uint32 =32-bit unsigned integer

int64 =64-bit signed integer


Data Type Conversion

MATLAB provides various functions for converting a value from one data type to another. The following table shows the data type conversion
functions:

Function Purpose Char Convert to character array (string) i

nt2str Convert integer data to string

mat2str Convert matrix to string

num2str Convert number to string

str2double Convert string to double-precision value


IF YOU WANT MORE INFORMATION ABOUT MATLAB OR MATLAB
ASSIGNMENT HELPTHEN YOU WILL CONTACT US:-

Website:- https://myassignmentmart.com/

Email:- [email protected]
Contact:- +61-2-4504-8305

You might also like