Professional Documents
Culture Documents
About MATLAB
MATLAB-MATrix LABoratory A numerical computing environment and programming language. Created by MathWorks Inc, MATLAB allows easy matrix manipulation, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs in other languages.
The beginning
MATLAB was invented in the late 1970s by Cleve Moler, then chairman of the Computer Science ,Department at the University of New Mexico In the mid to late 1970s, he was one of the authors of LINPACK and EISPACK, Fortran libraries for numerical computing.
He invented MATLAB, a numerical computing package, to give his students at the University of New Mexico easy access to these libraries without writing Fortran. In 1984, he co-founded The MathWorks with Jack Little to commercialize this program.
Communications Toolbox Control System Toolbox Curve Fitting Toolbox Data Acquisition Toolbox Database Toolbox Datafeed Toolbox Excel Link Filter Design Toolbox Filter Design HDL Coder Financial Toolbox Financial Derivatives Toolbox Fixed-Income Toolbox Fixed-Point Toolbox Fuzzy Logic Toolbox GARCH Toolbox
An extension of MATLAB
Simulink (Simulation and Link) is an extension of MATLAB by Mathworks Inc. It works with MATLAB to offer modeling, simulating, and analyzing of dynamical systems under a graphical user interface (GUI) environment. Simulink link contains toolboxes called blocksets
Event-Based Modeling Stateflow SimEvents Physical Modeling Simscape SimMechanics SimPowerSystems SimDriveline SimHydraulics Simulation Graphics Virtual Reality Toolbox Gauges Blockset
Blocksets
Control System Design and Analysis Simulink Control Design Simulink Response Optimization Simulink Parameter Estimation Aerospace Blockset Signal Processing and Communications Signal Processing Blockset Communications Blockset RF Blockset Video and Image Processing Blockset
Code Generation Real-Time Workshop Real-Time Workshop Embedded Coder Stateflow Coder Simulink HDL Coder Rapid Control Prototyping and HIL SW/HW xPC Target xPC Target Embedded Option Real-Time Windows Target Embedded Targets Target for Infineon C166 Target for Freescale MPC5xx Target for TI C2000 Target for TI C6000 Verification, Validation, and Testing Simulink Verification and Validation Simulink Design Verifier SystemTest MATLAB and Simulink Link Products Link for Analog Devices VisualDSP++ Link for Cadence Incisive Link for Code Composer Studio Link for ModelSim
Matrix operations
A=2; constant B=[ 1 2 3 ;4 5 6;7 8 9]; 3x3 matrix C= [ 2 4 6 8 9]; D= C+2; E= B (transpose) F= inv(B) inverse
Programming constructs
>> y=[]; >> for x=0.5:0.5:5 y=[y,2*x]; end >> y >> n=3; >> while(n ~= 0) n=n-1 end >> if(n < 0) -n elseif (n == 0) n=365 else n end
Files in matlab
*.m files both script and functions *.mat files Matlab data files in Simulink *.mdl
function y = average(x) % AVERAGE Mean of vector elements. % %AVERAGE(X), where X is a vector, is the mean of vector % elements. Nonvector input results in an error.% [m,n] = size(x); if (~((m == 1) | (n == 1)) | (m == 1 & n == 1)) error('Input must be a vector') end y = sum(x)/length(x); z = 1:99; average(z)
Plots
x = 0:0.1:4; y = sin(x.^2).*exp(-x); stem(x,y)
Skeletal template M-Code is generated automatically for the GUI Callback functions are available for user control
Callback functions
ButtonDownFcn Executes when the user presses a mouse button while the pointer is on or within five pixels of a component or figure. Callback Control action. Executes, for example, when a user clicks a push button or selects a menu item.
Dynamic Link Libraries-Access functions stored in external shared library (.dll) files Java--Work with objects constructed from Java API and third-party class packages Component Object Model and ActiveX--Integrate COM components into your application Web Services--Communicate between applications over a network using SOAP and WSDL Serial Port Devices- communicate with ports for external data transfer
External Interfaces
SISOtool
Simulink
Simulink *.mdl
Simulation configuration
LINKEXCHANGE-Links to latest development FILEEXCHANGE-The MATLAB Central File Exchange contains thousands of files contributed by users and developers of MATLAB, Simulink and related products NEWSGROUP-Queries ,FAQ and Webinars