SlideShare a Scribd company logo
A Training for EngineersintroducingMATLAB
Making you a  better Engineer132Basic MATLAB ProgrammingAdvanced MATLABEngineering ApplicationsRedefine your engineering
Basic MATLAB ProgrammingDesign, organize, and collaborate1
Session 1MATLAB Overview  What is MATLAB?
  Various use cases of MATLAB
  MATLAB environment
  OCTAVE Introduction and installation
  MATLAB Vs OCTAVESession 1: What is MATLABA High level programming Language.An interactive technical computing environment.Algorithm DevelopmentData Analysis and visualization Numerical Computation.Faster than traditional computing Language like C, C++ and Fortran.
Matlab Introduction
MATLAB - Application DomainNumerical computation: linear algebra, statistics, Fourier analysis, filtering, optimization, and numerical integrationSignal and Image processingCommunication SystemsControl DesignTest and measurement.Financial Modeling and AnalysisComputational Biology.Virtually Any engineering domain.
Developing Algorithm and ApplicationsMATLAB language supports vectors and matrix operations fundamental in engineeringNo need for low level administrative tasks like variable declaration, specifying data types and allocating data types. No need for compilation and linking (JIT).Easy design of Graphical user interface (GUI).Development Tools: MATLAB Editor, M-lint Code Checker, MATLAB profile, Directory Report.
Analyzing and accessing dataMATLAB supports entire data analysis process - from acquiring data, to preprocessing, visualization, and numerical analysis, to quality output.MATLAB product provides interactive tools and command-line functions for data analysis operations, including interpolation, decimation, correlation, Fourier analysis, statistics functions and matrix analysis. MATLAB is an efficient platform for accessing data from files, other applications, databases, and external devices through serial ports and sound cards, popular file formats such as Microsoft Excel; ASCII text or binary files; image, sound, and video files; and scientific files, such as HDF and HDF5, web-pages and XML.
Visualizing DataAll the graphics features that are required to visualize engineering and scientific data are available in MATLAB®. These include 2-D and 3-D plotting functions, 3-D volume visualization functions. 2-D Plotting: Line, area, bar, and pie chart, histogram, polygon and surface, scatter.3-D Plotting: Surface, contour, mesh, image, iso-surface.MATLAB lets you read and write common graphical and data file formats, such as GIF, JPEG, BMP, EPS, TIFF, PNG, HDF, AVI, and PCX.
Publishing Results and Deploying ApplicationsPublishing Results: Using the MATLAB Editor, you can automatically publish your MATLAB code in HTML, Word, LaTEX, and other formats.MATLAB provides functions for integrating C and C++ code, Fortran code, COM objects, and Java code with your applications. You can call DLLs, Java classes, and ActiveX controls.Using the MATLAB engine library, you can also call MATLAB from C, C++, or Fortran code.Deploying applications: Create your algorithm in MATLAB and distribute it to other MATLAB users directly as MATLAB code. Using the MATLAB Compiler (available separately), you can deploy your algorithm, as a stand-alone application or as a software module that you include in your project, to users who do not have MATLAB.
Getting Started to MATLABAn introductory video taken  from MATLAB  Product Page.Curtsey : MATLAB Inc
MATLAB EnvironmentThe MATLAB desktop environment consist of four main windows: Command Window Command HistoryCurrent Folder Window	 Workspace Browser
DescriptionCommand Window: A place where you type the command and instruction of MATLAB.Command History records all the commands entered in the command window.The Current folder is the directory where you can save your work. Go to File->Set Path to set the list of folders to be included in the search path. All the files and folders of the current folder are listed in the current folder browser. Workspace Browser is a place where all variables in the MATLAB’s current session are stored and accessed.
OCTAVEGNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically.It is mostly compatible with MATLAB.Interpreter provides convenient CLI.  (using libreadline)
Octave – Continued GNU Octave is a freely redistributable software. Octave and Octave-forge  includes a large set of toolbox present in MATLAB. Easily extendible in C++ using a well designed library.Uses tried and tested FORTRUN routine in backend. Community support on a very active mailing list. Well supported on Linux and MacOS.
Octave – The Down SideWindows Platform support is not good (using cygwin)Dependent on volunteers and the quality of their work.  IDE, profiler and GUI Lacking. Plots using GNUPlot which poses some problems – improvement on the way. Compiler (Just-in-time?)Domain Specific packages not mature.
Installation (OCTAVE/MATLAB)
Too much information?We will go slow and try to cover important aspects and use cases of MATLAB .End of Session 1?Ask Questions for the sake of those sitting around you.
Session 2MATLAB ProgrammingBasic Data typesMatrix and Linear AlgebraProgramming constructs and M-FilesData Import and export`Plots and Plotting toolsMATLAB Control flow
MATLAB is MATrixLABoratoryIn the MATLAB environment, a matrix is a rectangular array of numbers.Entering Matrix into MATLABExplicit list of elements.Load from external files.Generate matrix using Built-in functions.By default, MATLAB functions operate directly on matrix and no iteration logic need be implemented.
Hands on Session: S2C1% MATLAB Workshop For engineers% Author: Mayank Kumar% Company: IDEAS2IGNITE% Date: 20/09/2010%%Demonstrating MATRIX Manipulationsa=[8 1 6;3 5 7;4 9 2]b=sum(a)c=sum(a')'d=sum(diag(a))e=sum(diag(fliplr(a)))MATLA has a preference of working with column of Matrix. By default, ,MATLAB stores answer in ans variables. Transpose of MatrixDiagonal of Matrix
Accessing MATrix ElementsThe element in row i and column j of A is denoted by A(i,j).It is also possible to refer to the elements of a matrix with a single subscript, A(k).Matrix size is adaptive and increase with assignments outside the limits. Referring to outside location leads to error.
Colon OperatorColon operator helps in generating Arithmetic Sequences which are used to refer to Matrix elements in bulk. A:k:B => A sequence starting from A and ending on or before B with separation of K. A:B => Default separation of 1.: => Sequence range automatically guessed from matrix size. Read as ‘ALL’
Hands on Session: S2C2%% Understanding Colon OperatorsA=rand(10,10);B=A(:);stem(B,'.')mean(B)figurehist(B,10)%% More use of Colon Operator% Set all values greater than 0.8 to 0B(B>0.8)=0;figurehist(B)Smart use of colon operators to avoid for loops decrease program execution times. Matrix reference can be done using logic matrix.
Basic Programming componentsVariablesOperatorsMATLAB expressionFunctionsMATrix
Variables and NumbersMATLAB does not require any type declarations or dimension statements.MATLAB uses conventional decimal notation,Scientific notation uses the letter e to specify a power-of-ten scale factor.Imaginary numbers use either I or j as a suffix.MATLAB stores all numbers internally using the long format specified by the IEEE® floating-point standard.
MALAB Data Types
Integers
Floating Point Numbers	MATLAB construct double precision data type according to IEEE Standard 754. (64-bit)MATLAB construct single precision data type according to IEEE Standard 754. (32-bit)Precision consideration is very important when choosing the data-type for your computation. If you are aiming for embedded applications, you might have to make your algorithm work in single precisions.
Hands on Session: S2C3
Complex NumbersComplex numbers consist of two separate parts: a real part and an imaginary part. The basic imaginary unit is equal to the square root of -1.This is represented in MATLAB by either of two letters: i or j.Complex, real, imag, isreal
Infinity and NaNMATLAB uses the special values inf, -inf, and NaN to represent values that are positive and negative infinity, and not a number respectively.MATLAB represents infinity by the special value inf. Infinity results from operations like division by zero and overflow, which lead to results too large to represent as conventional floating-point values. Use the isinf function to verify that x is positive or negative infinity.
Operators
MATLAB Functions	MATLAB provides a large number of standard elementary mathematical functions and other application domain functions.These functions treat scalar and vectors in similar way.They work both for real and complex data making complex computation very easy. Some of the functions are built in. Built-in functions are part of the MATLAB core so they are very efficient, but the computational details are not readily accessible. Other functions are implemented in the MATLAB programing language, so their computational details are accessible.help elfunhelp specfunhelp elmat
Hands on Session: S2C4function [roots flag]=quadratic(a,b,c)if nargin==1    roots=[0 0];    flag=1; %Equal rootselse    if(a==0)fprintf('a must not be equal to zero')        roots=[NaNNaN];        flag=NaN;    else        alpha=(-b+sqrt(b.^2-4*a.*c))./(2.*a);        beta=(-b-sqrt(b.^2-4*a.*c))./(2.*a);        roots=[alpha beta];        if(b.^2-4*a.*c==0)            flag=1; %equal oots        else            flag=0; %unequall roots        end    end endHow to make a custom MATLAB Functions
Back to MATrixLABoratoryStandard Matrix GenerationZeros, Ones, Eye, Rand, randnLoad function can be used to read binary files containing matrix from earlier session or text file containing data. Concatenation Concatenation is the process of joining small matrices to make bigger ones. In fact, you made your first matrix by concatenating its individual elements. The pair of square brackets, [], is the concatenation operator.Rows or column can be deleted using a pair of square brackets.
Linear AlgebraDeterminant: det(A)reduced row echelon form: rref(A)Matrix Inversion: inv(A)Eigenvalues: eig(A)Coefficient of Characteristic polynomial: poly(A)Matrix Functions are column dominated.
Application: Solving Linear EquationsOne of the most important problems in technical computing is the solution of simultaneous linear equations. In matrix notation, this problem can be stated as follows.X = A\B: Denotes the solution to the matrix equation AX = B.X = B/A: Denotes the solution to the matrix equation XA = B.
Hands on Session: S2C5Solving Linear EquationsThe coefficient matrix A need not be square. If A is m-by-n, there are three cases: m = n Square system. Seek an exact solution.m > n Overdetermined system. Find a least squares solution.m < n Underdetermined system. Find a basic solution with at most m nonzero components.%% MATRIX Generations - 1A=[2 4 5; 1 3 5; 3 1 6];X=[2 5 7]';B=A*X; %AX = B %% Solution -1Y = A\B; % Standard Backslash operator used to solve the equation.
Other useful stuffsLogical Subscripting: The logical vectors created from logical and relational operations can be used to reference subarrays.Suppose X is an ordinary matrix and L is a matrix of the same size that is the result of some logical operation. Then X(L) specifies the elements of X where the elements of L are nonzero.Find: The find function determines the indices of array elements that meet a given logical condition.Format: format long, format short e, format bank, format rat, format hex.
Hands on Session S2C6A=1:1000;B=find(isprime(A))';A=A(isprime(A));scatter(B,A);
Plotting Graphs using MATLABThe MATLAB environment provides a wide variety of techniques to display data graphically.Interactive tools enable you to manipulate graphs to achieve results that reveal the most information about your data.You can also annotate and print graphs for presentations, or export graphs to standard graphics formats for presentation in Web browsers or other media
Creating a graph	The type of graph you choose to create depends on the nature of your data and what you want to reveal about the data.You can choose from many predefined graph types, such as line, bar, histogram, and pie graphs as well as 3-D graphs, such as surfaces, slice planes, and streamlines.There are two basic ways to create MATLAB graphs:Plotting tools to create graph interactivelyUsing CLI
Other AspectsExploring DataEditing the Graph componentAnnotating graphsPrinting and exporting GraphsAdding and removing figure contentSaving graphs for reuseFIG FileGenerated Codes
Graph ComponentsMATLAB graphs display in a special window known as a figure.Therefore, every graph is placed within axes defining a co-ordinate system, which are contained by the figure.You achieve the actual visual representation of the data with graphics objects like lines and surfaces.
A Basic Graph
GUI for plotting GraphsType plottoolsin the command window.The plotting tools are made up of three independent GUI components:Figure PalettePlot BrowserProperty EditorVisibility of these can be controlled from view menu.
GUI for plotting graph
Hands on S2C7This graph contains two y-axis, one for each plot – a lineseries and a stemseries.DemonstrateEditing basic propertiesSubplotsVarious types of graphEditing Plot in depth using property editorProperty InspectorMultiple plotsChanging current plot typesChanging data sourceAnnotating GraphExporting graphGenerating M-Code
Using Basic Plotting functionsCreating a Line graphPlot(y) produces a piecewise linear graph of the elements of y versus the index of the elements of y. Plot(x,y) produces a graph of y versus x. Plot(x,y,x,y2,x,y3) produces multiple graph in the same figure with different colors. It is possible to specify color, line-style and using plot command.plot(x,y,'color_style_marker')If Z is complex, plot(z) plots imag(z) vs real(z)
Using basic Plotting functions
Using basic Plotting functions
FigureUse hold on to plot more than 1 plot in same figure Graphing functions automatically open a new figure window if there are no figure windows already on the screen.To make an existing figure window the current figure, you can click the mouse while the pointer is in that window or you can typeFigure(n)Clf reset
SubplotsThe subplot command enables you to display multiple plots in the same window or print them on the same piece of paper. subplot(m,n,p)partitions the figure window into an m-by-n matrix of small subplots and selects the pth subplot for the current plot. The plots are numbered along the first row of the figure window, then the second row, and so on.
Controlling the AxisThe axis command provides a number of options for setting the scaling, orientation, and aspect ratio of graphs.Setting Axis Limitsaxis([xminxmaxyminymax])Setting the Axis Aspect Ratioaxis squareaxis equalaxis auto normal
Hands on S2C8
Control FlowConditional Control — if, else, switchswitch and caseForWhileContinuBreakError Control — try - catch – Advanced sessionsProgram Termination — return
Conditional StatementsA==BAn error when A and B not of same size. If(isequal(A,B))Returns a logical value of 1 (representing true) or 0(representing False), instead of a matrix.IsemptyAllany
Hands on S2C9Explains matrix comparison complexities.
Switch and Caseswitch (rem(n,4)==0) + (rem(n,2)==0)	case 0	M = odd_magic(n)	case 1	M = single_even_magic(n)	case 2	M = double_even_magic(n)	otherwise	error('This is impossible')EndBreak Statements are not required.
For LoopsIf you can replace for loops with colon operator, this will increase the efficiency of you code in MATLAB. All for loops cannot be replaced with colon operator. It depends on whether the functions used in the given scenario accepts and operates on MATRIX data typesEfficiency tips: Do not let the size of your matrix grow inside a loop. Better is to pre-allocate the desired size using matrix generator functions like zeros, ones etc
Hands on S2C10
While loopsContinue statementBreak Statement
Return StatementsReturn function that enables you to terminate your program before it runs to completion.A called function normally transfers control to the function that invoked it when it reaches the end of the function. You can insert a return statement within the called function to force an early termination and to transfer control to the invoking function.
Other Data StructureMultidimensional ArraysCell ArraysStructures
Multi-Dimensional ArraysMultidimensional arrays in the MATLAB environment are arrays with more than two subscripts.One way of creating a multidimensional array is by calling zeros, ones, rand, or randn with more than two arguments.A three-dimensional array might represent three-dimensional physical data, say the temperature in a room, sampled on a rectangular grid.Sum(m,d) – computes the sum by varying the dth subscript.
3-D Matrix
Cell ArraysCell arrays in MATLAB are multidimensional arrays whose elements are copies of other arrays.The cell functionBut, more often, cell arrays are created by enclosing a miscellaneous collection of things in curly braces, {}.To retrieve the contents of one of the cells, use subscripts in curly braces. Second, cell arrays contain copies of other arrays, not pointers to those arrays. If you subsequently change A, nothing happens to C.
Hands on S2C11You can use three-dimensional arrays to store a sequence of matrices of the same size.Cell arrays can be used to store a sequence of matrices of different sizes.
The Magic Cell
Character and TextStrings is stored as character arrays in MATLAB. The characters are stored as numbers, but not in floating-point format.a=double(‘hello’)B=char(a)F = reshape(32:127,16,6)';char(F)
Character and stringConcatenation Row wiseColumn wise using char functionAs a cell array – cellstr(S)
StructuresStructures are multidimensional MATLAB arrays with elements accessed by textual field designators.Field names of structures can be dynamic, and is evaluated during the runtime. Thus you can replace field names with other variables. structName.(expression)
Hands on S2C12
Scripts and functionsScripts – Collection of CLI commandsDeclaration of functionsNarginNargoutEval function
MATLAB ScriptsYou can enter commands from the language one at a time at the MATLAB command line.Or, you can write a series of commands to a file that you then execute as you would any MATLAB function.All the scripts given to you are actually MATLAB scripts and could be directly called my writing their name of the file in the command window if the folder is included in the path.Use the MATLAB Editor or any other text editor to create your own function files. Call these functions as you would any other MATLAB function or command.
MATLAB Program filesThere are two kinds of program files:Scripts, which do not accept input arguments or return output arguments. They operate on data in the workspace.Functions: which can accept input arguments and return output arguments. Internal variables are local to the function eg quadratic function we created yesterday. If you duplicate function names, MATLAB executes the one that occurs first in the search path.To view the contents of a program file, for example, myfunction.m, usetype myfunction
FunctionsFunctions are files that can accept input arguments and return output arguments.The names of the file and of the function should be the same.Functions operate on variables within their own workspace, separate from the workspace you access at the MATLAB command prompt.type rank
MATLAB FunctionsThe first line of a function starts with the keyword function.It gives the function name and order of arguments.The next several lines, up to the first blank or executable line, are comment lines that provide the help text. These lines are printed when you typehelp rank
MATLAB FunctionsMATLAB functions can have variable number of arguments not ordinarily found in other language. If no output argument is supplied, the result is stored in ans.Within the body of the function, two quantities named nargin and nargout are available that tell you the number of input and output arguments involved in each particular use of the function.
Primary and Subfunctionsfunction file contains a required primary function that appears first, and any number of subfunctions that may follow the primary. Primary functions havea wider scope than subfunctions.That is, primary functions can be called from outside of the file that defines them (e.g., from the MATLAB command line or from functions in other files) while subfunctions cannot. Subfunctions are visible only to the primary function and other subfunctions within their own file.
Private FunctionsA private function is a type of primary function. Its unique characteristic is that it is visible only to a limited group of other functions. This type of function can be useful if you want to limit access to a function, or when you choose not to expose the implementation of a function.Private functions reside in subfolders with the special name private. They are visible only to functions in the parent folder. For example, assume the folder newmath is on the MATLAB search path. A subfolder of newmath called private can contain functions that only the functions in newmath can call.
Nested FunctionsYou can define functions within the body of another function. These are said to be nested within the outer function. A nested function contains any or all of the components of any other function.In this example, function B is nested in  function A:function x = A(p1, p2)	...	B(p2)	function y = B(p3)		...	end	...end
Nested FunctionsLike other functions, a nested function has its own workspace where variables used by the function are stored. But it also has access to the workspaces of all functions in which it is nested.So, for example, a variable that has a value assigned to it by the primary function can be read or overwritten by a function nested at any level within the primary. Similarly, a variable that is assigned in a nested function can be read or overwritten by any of the functions containing that function.
Function OverloadingOverloaded functions are useful when you need to create a function that responds to different types of inputs accordingly.You can make this difference invisible to the user by creating two separate functions having the same name, and designating one to handle double types and one to handle integers. (more details on advanced session)
Global VariablesIf you want more than one function to share a single copy of a variable, simply declare the variable as global in all the functions.Do the same thing at the command line if you want the base workspace to access the variable.The global declaration must occur before the variable is actually used in a function.
String Arguments to functionsYou can write MATLAB functions that accept string arguments without the parentheses and quotes. That is, MATLAB interpretsfoo a b casfoo('a','b','c')
The eval functionThe eval function works with text variables to implement a powerful text macro facility. The expression or statement. The expression or statementeval(s)uses the MATLAB interpreter to evaluate the expression or execute the statement contained in the text string s.
The Function HandleYou can create a handle to any MATLAB function and then use that handle as a means of referencing the function.A function handle is typically passed in an argument list to other functions, which can then execute, or evaluate, the function using the handle.Construct a function handle in MATLAB using the at sign, @, before the function name.fhandle = @sin;
The Function HandleYou can call a function by means of its handle in the same way that you would call the function using its name.

More Related Content

What's hot (20)

PPTX
Machine learning ppt
Rajat Sharma
 
PPTX
K - Map
Abhishek Choksi
 
PPTX
Matlab simulink introduction
Ameen San
 
PPTX
Divergence,curl,gradient
Kunj Patel
 
PPTX
Numerical methods and its applications
HaiderParekh1
 
PPT
Introduction to matlab
Tarun Gehlot
 
PDF
summer training report on python
Shubham Yadav
 
PPTX
Radial basis function network ppt bySheetal,Samreen and Dhanashri
sheetal katkar
 
PPT
Vector analysis
NUSRAT JAHAN
 
PPTX
Application of eigen value eigen vector to design
Home
 
PPT
Brief Introduction to Matlab
Tariq kanher
 
PPTX
rank of matrix
Siddhi Agrawal
 
PPTX
Soft computing
ganeshpaul6
 
PPT
Fuzzy logic ppt
Priya_Srivastava
 
PPTX
INTRODUCTION TO MACHINE LEARNING.pptx
AbhigyanMishra17
 
PPTX
Nba sar ppt
Kim J Seelan
 
PPTX
Applications of numerical methods
Daffodil International University
 
PDF
Introduction to Numerical Analysis
Mohammad Tawfik
 
PDF
Introduction to soft computing
Siksha 'O' Anusandhan (Deemed to be University )
 
Machine learning ppt
Rajat Sharma
 
K - Map
Abhishek Choksi
 
Matlab simulink introduction
Ameen San
 
Divergence,curl,gradient
Kunj Patel
 
Numerical methods and its applications
HaiderParekh1
 
Introduction to matlab
Tarun Gehlot
 
summer training report on python
Shubham Yadav
 
Radial basis function network ppt bySheetal,Samreen and Dhanashri
sheetal katkar
 
Vector analysis
NUSRAT JAHAN
 
Application of eigen value eigen vector to design
Home
 
Brief Introduction to Matlab
Tariq kanher
 
rank of matrix
Siddhi Agrawal
 
Soft computing
ganeshpaul6
 
Fuzzy logic ppt
Priya_Srivastava
 
INTRODUCTION TO MACHINE LEARNING.pptx
AbhigyanMishra17
 
Nba sar ppt
Kim J Seelan
 
Applications of numerical methods
Daffodil International University
 
Introduction to Numerical Analysis
Mohammad Tawfik
 
Introduction to soft computing
Siksha 'O' Anusandhan (Deemed to be University )
 

Similar to Matlab Introduction (20)

PPT
INTRODUCTION TO MATLAB for PG students.ppt
Karthik537368
 
PDF
Introduction to MATLAB
Dun Automation Academy
 
PPT
MATLAB_CIS601-03.ppt
aboma2hawi
 
PDF
An Introduction to MATLAB with Worked Examples
eAssessment in Practice Symposium
 
PPT
MATLAB workshop lecture 1MATLAB work.ppt
ssuserdee4d8
 
PDF
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Ahmed Gad
 
PPTX
Mbd dd
Aditya Choudhury
 
PPT
Matlab Tutorial.ppt
RaviMuthamala1
 
PDF
++Matlab 14 sesiones
Rosemberth Rodriguez
 
PPTX
MATLAB & Image Processing
Techbuddy Consulting Pvt. Ltd.
 
PDF
EE6711 Power System Simulation Lab manual
Velalar College of Engineering and Technology
 
PDF
Basic matlab for beginners
Kwabena Owusu-Agyemang
 
PPT
MATLAB-tutorial for Image Processing with Lecture 3.ppt
ssuser5fb79d
 
PPTX
Simulation lab
Ezhilarasi Nagarajan
 
PPT
Matlab Overviiew
Nazim Naeem
 
PPTX
Matlab - Introduction and Basics
Techsparks
 
PDF
Malab tutorial
sisira senarathna
 
PPSX
Matlab basic and image
Divyanshu Rasauria
 
PDF
MATLAB_intro_lect1 details about matlab(1).pdf
juhishrivastava25
 
INTRODUCTION TO MATLAB for PG students.ppt
Karthik537368
 
Introduction to MATLAB
Dun Automation Academy
 
MATLAB_CIS601-03.ppt
aboma2hawi
 
An Introduction to MATLAB with Worked Examples
eAssessment in Practice Symposium
 
MATLAB workshop lecture 1MATLAB work.ppt
ssuserdee4d8
 
Introduction to MATrices LABoratory (MATLAB) as Part of Digital Signal Proces...
Ahmed Gad
 
Matlab Tutorial.ppt
RaviMuthamala1
 
++Matlab 14 sesiones
Rosemberth Rodriguez
 
MATLAB & Image Processing
Techbuddy Consulting Pvt. Ltd.
 
EE6711 Power System Simulation Lab manual
Velalar College of Engineering and Technology
 
Basic matlab for beginners
Kwabena Owusu-Agyemang
 
MATLAB-tutorial for Image Processing with Lecture 3.ppt
ssuser5fb79d
 
Simulation lab
Ezhilarasi Nagarajan
 
Matlab Overviiew
Nazim Naeem
 
Matlab - Introduction and Basics
Techsparks
 
Malab tutorial
sisira senarathna
 
Matlab basic and image
Divyanshu Rasauria
 
MATLAB_intro_lect1 details about matlab(1).pdf
juhishrivastava25
 
Ad

Recently uploaded (20)

PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Complete Network Protection with Real-Time Security
L4RGINDIA
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Complete Network Protection with Real-Time Security
L4RGINDIA
 
July Patch Tuesday
Ivanti
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Ad

Matlab Introduction

  • 1. A Training for EngineersintroducingMATLAB
  • 2. Making you a better Engineer132Basic MATLAB ProgrammingAdvanced MATLABEngineering ApplicationsRedefine your engineering
  • 3. Basic MATLAB ProgrammingDesign, organize, and collaborate1
  • 4. Session 1MATLAB Overview What is MATLAB?
  • 5. Various use cases of MATLAB
  • 6. MATLAB environment
  • 7. OCTAVE Introduction and installation
  • 8. MATLAB Vs OCTAVESession 1: What is MATLABA High level programming Language.An interactive technical computing environment.Algorithm DevelopmentData Analysis and visualization Numerical Computation.Faster than traditional computing Language like C, C++ and Fortran.
  • 10. MATLAB - Application DomainNumerical computation: linear algebra, statistics, Fourier analysis, filtering, optimization, and numerical integrationSignal and Image processingCommunication SystemsControl DesignTest and measurement.Financial Modeling and AnalysisComputational Biology.Virtually Any engineering domain.
  • 11. Developing Algorithm and ApplicationsMATLAB language supports vectors and matrix operations fundamental in engineeringNo need for low level administrative tasks like variable declaration, specifying data types and allocating data types. No need for compilation and linking (JIT).Easy design of Graphical user interface (GUI).Development Tools: MATLAB Editor, M-lint Code Checker, MATLAB profile, Directory Report.
  • 12. Analyzing and accessing dataMATLAB supports entire data analysis process - from acquiring data, to preprocessing, visualization, and numerical analysis, to quality output.MATLAB product provides interactive tools and command-line functions for data analysis operations, including interpolation, decimation, correlation, Fourier analysis, statistics functions and matrix analysis. MATLAB is an efficient platform for accessing data from files, other applications, databases, and external devices through serial ports and sound cards, popular file formats such as Microsoft Excel; ASCII text or binary files; image, sound, and video files; and scientific files, such as HDF and HDF5, web-pages and XML.
  • 13. Visualizing DataAll the graphics features that are required to visualize engineering and scientific data are available in MATLAB®. These include 2-D and 3-D plotting functions, 3-D volume visualization functions. 2-D Plotting: Line, area, bar, and pie chart, histogram, polygon and surface, scatter.3-D Plotting: Surface, contour, mesh, image, iso-surface.MATLAB lets you read and write common graphical and data file formats, such as GIF, JPEG, BMP, EPS, TIFF, PNG, HDF, AVI, and PCX.
  • 14. Publishing Results and Deploying ApplicationsPublishing Results: Using the MATLAB Editor, you can automatically publish your MATLAB code in HTML, Word, LaTEX, and other formats.MATLAB provides functions for integrating C and C++ code, Fortran code, COM objects, and Java code with your applications. You can call DLLs, Java classes, and ActiveX controls.Using the MATLAB engine library, you can also call MATLAB from C, C++, or Fortran code.Deploying applications: Create your algorithm in MATLAB and distribute it to other MATLAB users directly as MATLAB code. Using the MATLAB Compiler (available separately), you can deploy your algorithm, as a stand-alone application or as a software module that you include in your project, to users who do not have MATLAB.
  • 15. Getting Started to MATLABAn introductory video taken from MATLAB Product Page.Curtsey : MATLAB Inc
  • 16. MATLAB EnvironmentThe MATLAB desktop environment consist of four main windows: Command Window Command HistoryCurrent Folder Window Workspace Browser
  • 17. DescriptionCommand Window: A place where you type the command and instruction of MATLAB.Command History records all the commands entered in the command window.The Current folder is the directory where you can save your work. Go to File->Set Path to set the list of folders to be included in the search path. All the files and folders of the current folder are listed in the current folder browser. Workspace Browser is a place where all variables in the MATLAB’s current session are stored and accessed.
  • 18. OCTAVEGNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically.It is mostly compatible with MATLAB.Interpreter provides convenient CLI. (using libreadline)
  • 19. Octave – Continued GNU Octave is a freely redistributable software. Octave and Octave-forge includes a large set of toolbox present in MATLAB. Easily extendible in C++ using a well designed library.Uses tried and tested FORTRUN routine in backend. Community support on a very active mailing list. Well supported on Linux and MacOS.
  • 20. Octave – The Down SideWindows Platform support is not good (using cygwin)Dependent on volunteers and the quality of their work. IDE, profiler and GUI Lacking. Plots using GNUPlot which poses some problems – improvement on the way. Compiler (Just-in-time?)Domain Specific packages not mature.
  • 22. Too much information?We will go slow and try to cover important aspects and use cases of MATLAB .End of Session 1?Ask Questions for the sake of those sitting around you.
  • 23. Session 2MATLAB ProgrammingBasic Data typesMatrix and Linear AlgebraProgramming constructs and M-FilesData Import and export`Plots and Plotting toolsMATLAB Control flow
  • 24. MATLAB is MATrixLABoratoryIn the MATLAB environment, a matrix is a rectangular array of numbers.Entering Matrix into MATLABExplicit list of elements.Load from external files.Generate matrix using Built-in functions.By default, MATLAB functions operate directly on matrix and no iteration logic need be implemented.
  • 25. Hands on Session: S2C1% MATLAB Workshop For engineers% Author: Mayank Kumar% Company: IDEAS2IGNITE% Date: 20/09/2010%%Demonstrating MATRIX Manipulationsa=[8 1 6;3 5 7;4 9 2]b=sum(a)c=sum(a')'d=sum(diag(a))e=sum(diag(fliplr(a)))MATLA has a preference of working with column of Matrix. By default, ,MATLAB stores answer in ans variables. Transpose of MatrixDiagonal of Matrix
  • 26. Accessing MATrix ElementsThe element in row i and column j of A is denoted by A(i,j).It is also possible to refer to the elements of a matrix with a single subscript, A(k).Matrix size is adaptive and increase with assignments outside the limits. Referring to outside location leads to error.
  • 27. Colon OperatorColon operator helps in generating Arithmetic Sequences which are used to refer to Matrix elements in bulk. A:k:B => A sequence starting from A and ending on or before B with separation of K. A:B => Default separation of 1.: => Sequence range automatically guessed from matrix size. Read as ‘ALL’
  • 28. Hands on Session: S2C2%% Understanding Colon OperatorsA=rand(10,10);B=A(:);stem(B,'.')mean(B)figurehist(B,10)%% More use of Colon Operator% Set all values greater than 0.8 to 0B(B>0.8)=0;figurehist(B)Smart use of colon operators to avoid for loops decrease program execution times. Matrix reference can be done using logic matrix.
  • 30. Variables and NumbersMATLAB does not require any type declarations or dimension statements.MATLAB uses conventional decimal notation,Scientific notation uses the letter e to specify a power-of-ten scale factor.Imaginary numbers use either I or j as a suffix.MATLAB stores all numbers internally using the long format specified by the IEEE® floating-point standard.
  • 33. Floating Point Numbers MATLAB construct double precision data type according to IEEE Standard 754. (64-bit)MATLAB construct single precision data type according to IEEE Standard 754. (32-bit)Precision consideration is very important when choosing the data-type for your computation. If you are aiming for embedded applications, you might have to make your algorithm work in single precisions.
  • 35. Complex NumbersComplex numbers consist of two separate parts: a real part and an imaginary part. The basic imaginary unit is equal to the square root of -1.This is represented in MATLAB by either of two letters: i or j.Complex, real, imag, isreal
  • 36. Infinity and NaNMATLAB uses the special values inf, -inf, and NaN to represent values that are positive and negative infinity, and not a number respectively.MATLAB represents infinity by the special value inf. Infinity results from operations like division by zero and overflow, which lead to results too large to represent as conventional floating-point values. Use the isinf function to verify that x is positive or negative infinity.
  • 38. MATLAB Functions MATLAB provides a large number of standard elementary mathematical functions and other application domain functions.These functions treat scalar and vectors in similar way.They work both for real and complex data making complex computation very easy. Some of the functions are built in. Built-in functions are part of the MATLAB core so they are very efficient, but the computational details are not readily accessible. Other functions are implemented in the MATLAB programing language, so their computational details are accessible.help elfunhelp specfunhelp elmat
  • 39. Hands on Session: S2C4function [roots flag]=quadratic(a,b,c)if nargin==1 roots=[0 0]; flag=1; %Equal rootselse if(a==0)fprintf('a must not be equal to zero') roots=[NaNNaN]; flag=NaN; else alpha=(-b+sqrt(b.^2-4*a.*c))./(2.*a); beta=(-b-sqrt(b.^2-4*a.*c))./(2.*a); roots=[alpha beta]; if(b.^2-4*a.*c==0) flag=1; %equal oots else flag=0; %unequall roots end end endHow to make a custom MATLAB Functions
  • 40. Back to MATrixLABoratoryStandard Matrix GenerationZeros, Ones, Eye, Rand, randnLoad function can be used to read binary files containing matrix from earlier session or text file containing data. Concatenation Concatenation is the process of joining small matrices to make bigger ones. In fact, you made your first matrix by concatenating its individual elements. The pair of square brackets, [], is the concatenation operator.Rows or column can be deleted using a pair of square brackets.
  • 41. Linear AlgebraDeterminant: det(A)reduced row echelon form: rref(A)Matrix Inversion: inv(A)Eigenvalues: eig(A)Coefficient of Characteristic polynomial: poly(A)Matrix Functions are column dominated.
  • 42. Application: Solving Linear EquationsOne of the most important problems in technical computing is the solution of simultaneous linear equations. In matrix notation, this problem can be stated as follows.X = A\B: Denotes the solution to the matrix equation AX = B.X = B/A: Denotes the solution to the matrix equation XA = B.
  • 43. Hands on Session: S2C5Solving Linear EquationsThe coefficient matrix A need not be square. If A is m-by-n, there are three cases: m = n Square system. Seek an exact solution.m > n Overdetermined system. Find a least squares solution.m < n Underdetermined system. Find a basic solution with at most m nonzero components.%% MATRIX Generations - 1A=[2 4 5; 1 3 5; 3 1 6];X=[2 5 7]';B=A*X; %AX = B %% Solution -1Y = A\B; % Standard Backslash operator used to solve the equation.
  • 44. Other useful stuffsLogical Subscripting: The logical vectors created from logical and relational operations can be used to reference subarrays.Suppose X is an ordinary matrix and L is a matrix of the same size that is the result of some logical operation. Then X(L) specifies the elements of X where the elements of L are nonzero.Find: The find function determines the indices of array elements that meet a given logical condition.Format: format long, format short e, format bank, format rat, format hex.
  • 45. Hands on Session S2C6A=1:1000;B=find(isprime(A))';A=A(isprime(A));scatter(B,A);
  • 46. Plotting Graphs using MATLABThe MATLAB environment provides a wide variety of techniques to display data graphically.Interactive tools enable you to manipulate graphs to achieve results that reveal the most information about your data.You can also annotate and print graphs for presentations, or export graphs to standard graphics formats for presentation in Web browsers or other media
  • 47. Creating a graph The type of graph you choose to create depends on the nature of your data and what you want to reveal about the data.You can choose from many predefined graph types, such as line, bar, histogram, and pie graphs as well as 3-D graphs, such as surfaces, slice planes, and streamlines.There are two basic ways to create MATLAB graphs:Plotting tools to create graph interactivelyUsing CLI
  • 48. Other AspectsExploring DataEditing the Graph componentAnnotating graphsPrinting and exporting GraphsAdding and removing figure contentSaving graphs for reuseFIG FileGenerated Codes
  • 49. Graph ComponentsMATLAB graphs display in a special window known as a figure.Therefore, every graph is placed within axes defining a co-ordinate system, which are contained by the figure.You achieve the actual visual representation of the data with graphics objects like lines and surfaces.
  • 51. GUI for plotting GraphsType plottoolsin the command window.The plotting tools are made up of three independent GUI components:Figure PalettePlot BrowserProperty EditorVisibility of these can be controlled from view menu.
  • 53. Hands on S2C7This graph contains two y-axis, one for each plot – a lineseries and a stemseries.DemonstrateEditing basic propertiesSubplotsVarious types of graphEditing Plot in depth using property editorProperty InspectorMultiple plotsChanging current plot typesChanging data sourceAnnotating GraphExporting graphGenerating M-Code
  • 54. Using Basic Plotting functionsCreating a Line graphPlot(y) produces a piecewise linear graph of the elements of y versus the index of the elements of y. Plot(x,y) produces a graph of y versus x. Plot(x,y,x,y2,x,y3) produces multiple graph in the same figure with different colors. It is possible to specify color, line-style and using plot command.plot(x,y,'color_style_marker')If Z is complex, plot(z) plots imag(z) vs real(z)
  • 57. FigureUse hold on to plot more than 1 plot in same figure Graphing functions automatically open a new figure window if there are no figure windows already on the screen.To make an existing figure window the current figure, you can click the mouse while the pointer is in that window or you can typeFigure(n)Clf reset
  • 58. SubplotsThe subplot command enables you to display multiple plots in the same window or print them on the same piece of paper. subplot(m,n,p)partitions the figure window into an m-by-n matrix of small subplots and selects the pth subplot for the current plot. The plots are numbered along the first row of the figure window, then the second row, and so on.
  • 59. Controlling the AxisThe axis command provides a number of options for setting the scaling, orientation, and aspect ratio of graphs.Setting Axis Limitsaxis([xminxmaxyminymax])Setting the Axis Aspect Ratioaxis squareaxis equalaxis auto normal
  • 61. Control FlowConditional Control — if, else, switchswitch and caseForWhileContinuBreakError Control — try - catch – Advanced sessionsProgram Termination — return
  • 62. Conditional StatementsA==BAn error when A and B not of same size. If(isequal(A,B))Returns a logical value of 1 (representing true) or 0(representing False), instead of a matrix.IsemptyAllany
  • 63. Hands on S2C9Explains matrix comparison complexities.
  • 64. Switch and Caseswitch (rem(n,4)==0) + (rem(n,2)==0) case 0 M = odd_magic(n) case 1 M = single_even_magic(n) case 2 M = double_even_magic(n) otherwise error('This is impossible')EndBreak Statements are not required.
  • 65. For LoopsIf you can replace for loops with colon operator, this will increase the efficiency of you code in MATLAB. All for loops cannot be replaced with colon operator. It depends on whether the functions used in the given scenario accepts and operates on MATRIX data typesEfficiency tips: Do not let the size of your matrix grow inside a loop. Better is to pre-allocate the desired size using matrix generator functions like zeros, ones etc
  • 68. Return StatementsReturn function that enables you to terminate your program before it runs to completion.A called function normally transfers control to the function that invoked it when it reaches the end of the function. You can insert a return statement within the called function to force an early termination and to transfer control to the invoking function.
  • 69. Other Data StructureMultidimensional ArraysCell ArraysStructures
  • 70. Multi-Dimensional ArraysMultidimensional arrays in the MATLAB environment are arrays with more than two subscripts.One way of creating a multidimensional array is by calling zeros, ones, rand, or randn with more than two arguments.A three-dimensional array might represent three-dimensional physical data, say the temperature in a room, sampled on a rectangular grid.Sum(m,d) – computes the sum by varying the dth subscript.
  • 72. Cell ArraysCell arrays in MATLAB are multidimensional arrays whose elements are copies of other arrays.The cell functionBut, more often, cell arrays are created by enclosing a miscellaneous collection of things in curly braces, {}.To retrieve the contents of one of the cells, use subscripts in curly braces. Second, cell arrays contain copies of other arrays, not pointers to those arrays. If you subsequently change A, nothing happens to C.
  • 73. Hands on S2C11You can use three-dimensional arrays to store a sequence of matrices of the same size.Cell arrays can be used to store a sequence of matrices of different sizes.
  • 75. Character and TextStrings is stored as character arrays in MATLAB. The characters are stored as numbers, but not in floating-point format.a=double(‘hello’)B=char(a)F = reshape(32:127,16,6)';char(F)
  • 76. Character and stringConcatenation Row wiseColumn wise using char functionAs a cell array – cellstr(S)
  • 77. StructuresStructures are multidimensional MATLAB arrays with elements accessed by textual field designators.Field names of structures can be dynamic, and is evaluated during the runtime. Thus you can replace field names with other variables. structName.(expression)
  • 79. Scripts and functionsScripts – Collection of CLI commandsDeclaration of functionsNarginNargoutEval function
  • 80. MATLAB ScriptsYou can enter commands from the language one at a time at the MATLAB command line.Or, you can write a series of commands to a file that you then execute as you would any MATLAB function.All the scripts given to you are actually MATLAB scripts and could be directly called my writing their name of the file in the command window if the folder is included in the path.Use the MATLAB Editor or any other text editor to create your own function files. Call these functions as you would any other MATLAB function or command.
  • 81. MATLAB Program filesThere are two kinds of program files:Scripts, which do not accept input arguments or return output arguments. They operate on data in the workspace.Functions: which can accept input arguments and return output arguments. Internal variables are local to the function eg quadratic function we created yesterday. If you duplicate function names, MATLAB executes the one that occurs first in the search path.To view the contents of a program file, for example, myfunction.m, usetype myfunction
  • 82. FunctionsFunctions are files that can accept input arguments and return output arguments.The names of the file and of the function should be the same.Functions operate on variables within their own workspace, separate from the workspace you access at the MATLAB command prompt.type rank
  • 83. MATLAB FunctionsThe first line of a function starts with the keyword function.It gives the function name and order of arguments.The next several lines, up to the first blank or executable line, are comment lines that provide the help text. These lines are printed when you typehelp rank
  • 84. MATLAB FunctionsMATLAB functions can have variable number of arguments not ordinarily found in other language. If no output argument is supplied, the result is stored in ans.Within the body of the function, two quantities named nargin and nargout are available that tell you the number of input and output arguments involved in each particular use of the function.
  • 85. Primary and Subfunctionsfunction file contains a required primary function that appears first, and any number of subfunctions that may follow the primary. Primary functions havea wider scope than subfunctions.That is, primary functions can be called from outside of the file that defines them (e.g., from the MATLAB command line or from functions in other files) while subfunctions cannot. Subfunctions are visible only to the primary function and other subfunctions within their own file.
  • 86. Private FunctionsA private function is a type of primary function. Its unique characteristic is that it is visible only to a limited group of other functions. This type of function can be useful if you want to limit access to a function, or when you choose not to expose the implementation of a function.Private functions reside in subfolders with the special name private. They are visible only to functions in the parent folder. For example, assume the folder newmath is on the MATLAB search path. A subfolder of newmath called private can contain functions that only the functions in newmath can call.
  • 87. Nested FunctionsYou can define functions within the body of another function. These are said to be nested within the outer function. A nested function contains any or all of the components of any other function.In this example, function B is nested in function A:function x = A(p1, p2) ... B(p2) function y = B(p3) ... end ...end
  • 88. Nested FunctionsLike other functions, a nested function has its own workspace where variables used by the function are stored. But it also has access to the workspaces of all functions in which it is nested.So, for example, a variable that has a value assigned to it by the primary function can be read or overwritten by a function nested at any level within the primary. Similarly, a variable that is assigned in a nested function can be read or overwritten by any of the functions containing that function.
  • 89. Function OverloadingOverloaded functions are useful when you need to create a function that responds to different types of inputs accordingly.You can make this difference invisible to the user by creating two separate functions having the same name, and designating one to handle double types and one to handle integers. (more details on advanced session)
  • 90. Global VariablesIf you want more than one function to share a single copy of a variable, simply declare the variable as global in all the functions.Do the same thing at the command line if you want the base workspace to access the variable.The global declaration must occur before the variable is actually used in a function.
  • 91. String Arguments to functionsYou can write MATLAB functions that accept string arguments without the parentheses and quotes. That is, MATLAB interpretsfoo a b casfoo('a','b','c')
  • 92. The eval functionThe eval function works with text variables to implement a powerful text macro facility. The expression or statement. The expression or statementeval(s)uses the MATLAB interpreter to evaluate the expression or execute the statement contained in the text string s.
  • 93. The Function HandleYou can create a handle to any MATLAB function and then use that handle as a means of referencing the function.A function handle is typically passed in an argument list to other functions, which can then execute, or evaluate, the function using the handle.Construct a function handle in MATLAB using the at sign, @, before the function name.fhandle = @sin;
  • 94. The Function HandleYou can call a function by means of its handle in the same way that you would call the function using its name.
  • 95. Hands on Session S2C13 – fun_plot
  • 96. We have covered basesWe will now move on to some engineering application of MATLAB before covering some advanced topics. End of Session 2?Ask Questions for the sake of those sitting around you.
  • 97. MayankKumarContact the author at mayank [at] ideas2ignite [dot] com for more Tutorials on MATLAB for Electrical Engineers. Attribution-Non Commercial-ShareAlike3.0 Unported (CC BY-NC-SA 3.0) IDEAS2IGNITE

Editor's Notes

  • #2: This presentation demonstrates the new capabilities of PowerPoint and it is best viewed in Slide Show. These slides are designed to give you great ideas for the presentations you’ll create in PowerPoint 2010!For more sample templates, click the File tab, and then on the New tab, click Sample Templates.
  • #22: Special meaning is sometimes attached to 1-by-1 matrices, which are scalars, and to matrices with only one row or column, which are vectors. MATLAB has other ways of storing both numeric and nonnumeric data, but in the beginning, it is usually best to think of everything as a matrix.Magic Squares are special matrix whose row, column and diagonal sum are all equal. Considered to be very auspecious.
  • #25: Colon operator replaces the much used for loops for array referencing used in conventional programming language.