MATLAB Open Ended Lab Final
MATLAB Open Ended Lab Final
MATLAB Open Ended Lab Final
SAHIWAL
SEMESTER: 7𝑡ℎ
Group Members
Functionality
Built-in Functionality includes
Matrix manipulation and linear algebra
Mathematical computation
Algorithm development
Data acquisition
Modeling, simulation, and prototyping
Data analysis, exploration, and visualization
Scientific and engineering graphics
Add-on toolboxes provide
Image processing
Signal Processing
Optimization
Genetic Algorithms
MATLAB paradigm
MATLAB is an interactive environment
Commands are interpreted one line at a time
Commands may be scripted to create your own functions or
Procedures
Variables are created when they are used
Variables are typed, but variable names may be reused for
different types
Basic data structure is the matrix
Matrix dimensions are set dynamically
MATLAB Desktop
Command Window: Where you enter commands
Command History: running history of commands which is preserved across MATLAB
sessions
Current directory: Default is $mart lab root/work
Workspace: GUI for viewing, loading and saving MATLAB variables
Editor/Debugger: text editor, debugger; editor works with file types in addition to .m
(MATLAB “m files”)
Operations in MATLAB
Arithmetic Operation
To sum up x + y <Enter>
Subtraction x - y <Enter>
Multiplication x * y <Enter>
Division x / y <Enter>
x \ y <Enter>
Exponent x ^ y <Enter>
Variables
Assign variables to do the arithmetic
Operations to use the result in further
calculations
Variable name consists only of:
Letters from a-z Numbers from 0-9 underscore ( _ )
It must start with a letter.
Matrix operations
^: exponentiation
*: multiplication
/: division
\: left division. The operation A\B is effectively the same as INV(A)*B, although left
division is calculated differently and is much quicker.
+: addition
-: subtraction
Creating Vectors and Matrices
>> A = [16 3; 5 10]
A = 16 3
5 10
>> B = [3 4 5
6 7 8]
B=3 4 5
6 7 8
Array Operations
Evaluated element by element
.' : array transpose
.^ : array power
.* : array multiplication
./ : array division
Very different from Matrix operations
Simulink in MATLAB
Simulink is an environment for simulation and model-based design for dynamic and
embedded systems. It provides an interactive graphical environment and a customizable set
of block libraries that let you design, simulate, implement, and test a variety of time-varying
systems, including communications, controls, signal processing, video processing, and image
processing.
Simulink offers:
A quick way of developing your model in contrast to text based-programming
language such as e.g., C.
Simulink has integrated solvers. In text based-programming language such as e.g., C
you need to write your own solver
P1=20+64=84KN
P1=30+64=94KN
UDL =10+64=74KN/m