Export file
Export file
THEORY:
MATLAB stands for Matrix Laboratory. It is a high-performance language that is used for
technical computing. It was developed by Cleve Molar of the company MathWorks.Inc in the
year 1984.It is written in C, C++, Java. It allows matrix manipulations, plotting of functions,
implementation of algorithms and creation of user interfaces.
Command Window: In this window one must type and immediately execute the
statements, as it requires quick prototyping. These statements cannot be saved.
Thus, this is can be used for small, easily executable programs.
Editor (Script): In this window one can execute larger programs with multiple
statements, and complex functions These can be saved and are done with the file
extension ‘.m ‘
Workspace: In this window the values of the variables that are created in the
course of the program (in the editor) are displayed.
Command History window : This window displays a log of statements that you
ran in the current and previous MATLAB sessions. The Command History lists the
time and date of each session in the short date format for your operating system,
followed by the statements from that session.
This window displays the exact location(path) of the program file being created.
MATLAB Library comes with a set of many inbuilt functions. These functions mostly perform
mathematical operations like sine, cosine and tangent. They perform more complex
functions too like finding the inverse and determinant of a matrix, cross product and dot
product Although MATLAB is encoded in C, C++ and Java, it is a lot easier to implement than
these three languages. For example, unlike the other three, no header files need to be
initialised in the beginning of the document and for declaring a variable, the data type need
not be provided. It provides an easier alternative for vector operations. They can be
performed using one command instead of multiple statements in a for or while loop.
Basic Functions in MATLAB
Function Description
The values or the text printed within single quotes is displayed on the
disp()
output screen
atan2(x,
To compute the arctangent or inverse of y/x
y)
2. Using Editor: Multiple lines of code can be written here and only after pressing the
run button (or F5) will the code be executed. It is always a good practice to write clc,
clear and close all in the beginning of the program.
Note: Statements ending with a semicolon will not be displayed in the command
window, however, their values will be displayed in the workspace. Any statement
followed by % in MATLAB is considered as a comment
Command Description
A(:, m:n) To extract the elements of all rows between columns m and n of the matrix
A(m:n, : ) To extract the elements of all columns between rows m and n of the matrix
Command Description
To extract the elements of rows between p and q and columns between m and n of
A(p:q, m:n)
the matrix
USES OF MATLAB:
Typical uses includes :
Math and computation.
Algorithm development.
Modelling, simulation and prototyping.
Data scientific, exploration and visualization.
Scientific and engineering graphics.
Application development including Graphical User Interface building.