0% found this document useful (0 votes)
59 views18 pages

Mathlab FINAL VERSION

This document provides an overview of MATLAB, including: 1) MATLAB is a programming software designed for engineering and science to analyze systems through matrix operations and data visualization. 2) MATLAB uses a matrix-based programming language and provides a desktop environment for iterative design processes. It allows natural expression of computational mathematics. 3) Key capabilities of MATLAB include numerical computation, symbolic computing, and graphical simulation through toolboxes like Simulink.

Uploaded by

Soul Reapers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views18 pages

Mathlab FINAL VERSION

This document provides an overview of MATLAB, including: 1) MATLAB is a programming software designed for engineering and science to analyze systems through matrix operations and data visualization. 2) MATLAB uses a matrix-based programming language and provides a desktop environment for iterative design processes. It allows natural expression of computational mathematics. 3) Key capabilities of MATLAB include numerical computation, symbolic computing, and graphical simulation through toolboxes like Simulink.

Uploaded by

Soul Reapers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Manual of Operations of So

Final Term Requirement for Computer Applications for


MATLAB, which stands for "MATrix LABoratory", is a math computing environment and
proprietary multi-paradigm programming language created by MathWorks. Matrix operations,
function and data visualization, algorithm implementation, user interface design, and language
interface programming are all possible with MATLAB.
MATLAB is a programming software designed specifically for the field of engineering and
scientist to design, analyze systems and products that help the humankind. MATLAB language is
what the software uses, it is a matrix-based language that allows the most natural expression of
computational mathematics.
MATLAB creates a desktop environment tuned for iterative analysis and design processes
with a MATLAB programming language that expresses matrix and array mathematics directly.
Live Editor for creating scripts that combine code, output, and formatted text in an executable
notebook are also included.
While MATLAB is primarily designed for numerical computation, symbolic computing
capabilities can be accessed through an extra toolbox that use the MuPAD symbolic engine.
Simulink is an extra program that offers model-based design for dynamic and embedded
systems as well as graphical multi-domain simulation.

INTERFACE
Opening the software, the loading screen will look like this:
KEYBOARD SHORTCUTS FOR WINDOWS
Data from the MATHLAB website https://www.mathworks.com/help/matlab/matlab_env/accessibility-use-
keyboard-shortcuts-to-navigate-matlab.html

ACTIONS KEYBOARD SHORTCUT


Move to the next visible panel. Ctrl+Tab
Move to the previous visible panel. Ctrl+Shift+Tab
Move to the next tab in a panel. Ctrl+Page Down
Move to the previous tab in a panel. Ctrl+Page Up
Make an open tool the active tool. Command Window: Ctrl+0
Command History: Ctrl+1
Current Folder: Ctrl+2
Workspace: Ctrl+3
Profiler: Ctrl+4
Figure Palette: Ctrl+6
Plot Browser: Ctrl+7
Property Editor: Ctrl+8
Editor: Ctrl+Shift+0
Figures: Ctrl+Shift+1
Web browser: Ctrl+Shift+2
Variables Editor: Ctrl+Shift+3
Comparison Tool: Ctrl+Shift+4
Help browser: Ctrl+Shift+5
Move between code and output in the Live Ctrl+Shift+O
Editor when output is on the right.
Show access keys for the toolstrip tabs. Alt
Select or open a toolstrip tab and show the Press Alt to show the access keys for the
access keys for each item on the tab. toolstrip tabs and then <character> to select
or open a tab, where <character> is the
displayed access key for the desired toolstrip
tab.

For example, press Alt followed by H to select


or open the Home tab and display the access
keys for the items on that tab.
MATRIX AND ARRAYS
A matrix is a rectangular array of numbers in MATLAB. Particular significance is
occasionally joined to scalar 1-by-1 matrices and matrices with merely a single vector row or
column. Other ways to save data in MATLAB both numerical and non-numerical data, however
initially, it is typically preferable to consider everything as a matrix. MATLAB operations are
intended to be as organic as feasible. When utilizing different programming languages users can
work with whole matrices in MATLAB by entering numbers one at a time, swiftly and
effortlessly.

Entering Matrices
Users can get started in knowing the MATLAB software by handling matrices. Users can
enter matrices in several different ways:
• Enter an explicit list of elements.
• Load matrices from external data files.
• Generate matrices using built-in functions.
• Create matrices with your own functions in M-files.
Start by entering Dürer’s matrix as a list of its elements. You only have to
follow a few basic conventions:
• Separate the elements of a row with blanks or commas.
• Use a semicolon, ; , to indicate the end of each row.
• Surround the entire list of elements with square brackets, [ ].

To enter Dürer’s matrix, users can type in the Command Window


A = [16 3 2 13; 5 10 11 8; 9 6 7 12; 4 15 14 1]
MATLAB displays the matrix you just entered:
A=
16 3 2 13

5 10 11 8

9 6 7 12
4 15 14 1

The numerals in the engraving correspond to this matrix. The matrix is automatically
remembered in the MATLAB workspace once it has been entered. It can be referred to as just A.

Sum, Transpose, And Diagonal


Regardless of the row, column, or both major diagonals along which the sum is run, the
result is always the same. Employing MATLAB to verify it. To begin, try sum(A). MATLAB
responds with ans = 34 34 34 34.
MATLAB stores the results of a calculation in the variable ans, which stands for answer,
when users do not specify an output variable. A row vector including the sums of A's columns
was computed by users. The sum of each column was the same.
The method to obtain the row sums is to transpose the matrix, compute the column
sums of the transpose, and then transpose the result because MATLAB prefers to work with a
matrix's columns when calculating row sums. An apostrophe or single quote, ', indicates the
transposition operation. It transforms a row vector into a column vector and flips a matrix about
its primary diagonal.
A' produces:
ans =
16 5 9 4
3 10 6 15
2 11 7 14
13 8 12 1
And sum(A')' produces a column vector containing the row sums:
ans =
34
34
34
34
The sum of the elements on the main diagonal is obtained with the sum and the
diag functions:
diag(A) produces:
ans =
16
10
7
1
And sum(diag(A)) produces:
ans =
34
The so-called antidiagonal, the opposing diagonal, is less significant. mathematically,
hence there isn't a pre-made function for it in MATLAB. However, a fliplr, a function designed
primarily for usage in graphics, flips a matrix from left to right.

from right to left:


summarize(diag(fliplr(A)))
ans =
34

EXPRESSIONS

VARIABLES
No type declarations or dimension expressions are needed while using MATLAB.
MATLAB automatically creates the new variable whenever it comes across one variable and
allots the suitable quantity of storage. Should the variable MATLAB modify the data that already
exists and, if required, allocates new storing. As an illustration, num_students = 25 generates
the num_students 1-by-1 matrix and inserts the number 25 in its one piece.
Variable names start with a letter and can have any number of characters, numbers, or
emphasizes. Only the first 31 characters of a variable name are used by MATLAB. MATLAB
recognizes uppercase and lowercase letters differently based on case letters. A is not the same
variable as a. To see the matrix that is connected to any just type the name of the variable.

NUMBERS
Conventional decimal notation is used in MATLAB, with an optional decimal point.

and, for numerals, the leading plus or minus sign. When using scientific notation, the letter
e to designate a scale factor with a power of 10. In imaginary numbers, i or j are used as a
postfix. A few instances of lawful numbers include:
3 -99 0.0001
9.6397238 1.60210e-20 6.02252e23
1i -3.14159j 3e5i
Expressions
2-11
Every integer is internally kept in the IEEE-specified long format float-point convention.
Numbers that are floating-point have a limited precision of 16 significant decimal places, with a
limited range of around 10−308 to 10308.

OPERATORS
Expressions use familiar arithmetic operators and precedence rules like the list below:
+ Addition
- Subtraction
* Multiplication
/ Division
\ Left division (described in “Matrices and Linear
Algebra” in the MATLAB documentation)
^ Power
' Complex conjugate transpose
( ) Specify evaluation order

FUNCTIONS
MATLAB offers a multitude of common simple mathematics functions such as sqrt, exp,
sin, and abs. squaring the root of a negative number's logarithm is not erroneous; the proper
complex result is generated automatically. However, MATLAB offers a lot more sophisticated
Bessel and gamma functions are examples of mathematical functions. The majority of these
functions take in complicated input.
for a compilation of the basic mathematics roles,
help elfun
to view a collection of more complex matrix and mathematical functions, type
assist specfun
assist elmat
MATLAB Tabs and Parts and their Functions

HOME TAB
Users can perform general purpose tasks such as controlling your workspace, importing
data, creating new files, and configuring your desktop layout on the Home tab, which is
displayed below.

PLOTS TAB
A gallery of MATLAB's available plots as well as any installed toolboxes may be seen
under the Plots tab. Users first choose whatever variables in the Workspace users want to plot,
and then users choose the kind of visualization users want to apply to that data, in order to
build a plot from the gallery. The entire plot gallery, along with many more options, can be
accessed by clicking the downward-pointing arrow located on the far right. The gallery is
intelligent; it only displays charts that make sense with the data users have chosen.

APPS TABS
Users can execute interactive MATLAB applications. An application gallery with installed
apps is displayed on the Apps tab. The apps gallery's entire extent and a plethora of other
options are brought down by the downward-pointing arrow located on the far right. Users can
click on the corresponding icon to launch a program.
COMMAND WINDOW

A window on which the user types the command that he/she wanted that the software
needs to run. The Command Window can act as a calculator, values inputted can be calculated
and other functions can be use.
The prompt (>>) in the Command Window indicates that you can type individual
statements at the command line. The Command Window shows the output as you type
statements.
For instance, enter a = 1 at the command line and hit Enter to create the variable a. The
variable is added to the workspace by MATLAB®, and the outcome is shown in the Command
Window. Use a semicolon to finish statements in order to prevent the output from being
displayed, for instance, a = 1;.
The results of your calculation are stored in MATLAB's variable ans, which stands for
answer, if you do not specify an output variable. Every command that delivers an output value
unassigned to a variable modifies the value of ans.
To enter the multiple statements at the command line, the user shall press Shift + Enter
between statements. This key combination is unnecessary when you enter a paired keyword
statement on multiple lines, such as for and end.
To clear a statement from the command line without executing it, the user shall press
the Esc key.
To recall previous statements, the user can press the Up arrow ↑ key. Upon executing
the command, the Command History window opens and displays a log of previous statements.
To recall a specific statement, users can type any part of the statement and then press
the Up-arrow key. For example, to recall the command b = 2, type b, and then press the Up-
arrow key.
To clear the Command Window, users can call the clc function on which users can type
clc in the command window and hit enter.
To clear the Command Window without deleting any text, users can call the home
function instead. Calling the home function moves the cursor to the upper-left corner of the
Command Window and scrolls all visible text out of view, giving the appearance of clearing the
screen without deleting any text.
To evaluate a statement already in the Command Window, users can select a statement,
right-click, and then select Evaluate Selection.
To execute only a portion of the code currently at the command line, users can select the
code at the command line and then press Enter.
CONTEXTUAL TABS
Global tabs are always available in MATLAB like the HOME, PLOT and APPS tab. The
Toolstrip supports contextual tabs in addition to global tabs. In MATLAB, contextual tabs are
only visible when performing specific tasks.

EDITOR TAB
The functions users require to edit file are all available on the Editor tab. The Editor's
amazing features are all arranged to make them simpler to locate and utilize. Opened over the
Desktop layout is this window.

PUBLISH TAB
All of the formatting options you require to produce stunning MATLAB papers with
publishing are gathered under the Publish tab.
VIEW TAB
In the VIEW Tab users can adjust, zoom in or zoom out, expand, collapse, and all
functionalities in tiles, document tabs, split document, display, zoom and code folding.

LIVE EDITOR TAB


Users can create a live script that can combine code, output and formatted text in a
single executable document.
The LIVE EDITOR Tab can be access at the Home Tab through creating a New Live Script.
INSERT TAB
Users can insert code, section, text, table, image, link, and equation.

ONLINE HELP
There are various methods by which you can obtain the online support. typing
assistance at the command prompt will display a lengthy list of subjects with available support.
Users can try typing help general as an example. Currently, a comprehensive list of "generic
purpose" MATLAB instructions. Lastly, attempt to assist in solving to discover the command to
execute. In each of the aforementioned cases, more details than your screen may hold and
scroll through. There is a far easier method to get the internet assistance, which is via MATLAB
Help Browser.
Users can also type F1 to open a Help Center. All information and functions of the
software can be seen on this page. Including Documentation, Examples, Functions, Blocks, and
Apps.

SAVING AND SAVING OPTIONS


Users can save the workspace that they created by using the command CTRL + S or
clicking the Save Workspace. The Save Workspace can be seen on the HOME Tab.
Users can save the file that they created as either MAT files (*.mat), MATLAB Script (*.m)
or All Foles (*.*).

OPENING A MATLAB FILE


Users can open a MATLAB Files existing or had been saved earlier. It can be also located
on the HOME TAB.

CLOSING THE MATLAB SOFTWARE


To end your MATLAB session, type quit in the Command Window, or select File −→ Exit
MATLAB in the desktop main menu.

You might also like