introduction to matlab - utoledo.eduwolson/mime3380/lecture 6...importing data – data set for...
TRANSCRIPT
![Page 2: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/2.jpg)
2
MATLABThe Language for Technical Computing
Key Features– High-level language of technical computing– Development environment for engineers, scientists– Interactive tools for design, problem solving– Mathematical function libraries– Graphics and data visualization tools– Custom GUIs– External Interfaces: C, C++, Fortran, Java, COM,
Excel, .NET
![Page 3: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/3.jpg)
3
Explore and Discover
Automate
Access
Technical Computing WorkflowShare
![Page 4: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/4.jpg)
7
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB
![Page 5: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/5.jpg)
8
MATLAB Desktop
![Page 6: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/6.jpg)
9
Workspace Browser
![Page 7: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/7.jpg)
11
Getting Help
doc
Start -> Help http://mathworks.in ->
Support -> Product Documentation
help
Search the web
![Page 8: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/8.jpg)
12
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB
![Page 9: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/9.jpg)
14
Basics: Data and Variables
Class Size Value
![Page 10: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/10.jpg)
15
Basics: Data and Variables
Class Size Value
m*nm*n*…*z
![Page 11: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/11.jpg)
16
Basics: Data and Variables
Class Size Value
![Page 12: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/12.jpg)
17
Basics: Data and Variables
Class Size Value Name (“variable”)
foo
![Page 13: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/13.jpg)
19
Basics: Manipulating Data
Creation Extraction (subset) Union (merge) Deletion
![Page 14: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/14.jpg)
20
Basics: Manipulating Data
Creation Extraction (subset) Union (merge) Deletion
:randzerosonesdiagmagic;endlinspacelogspace…
![Page 15: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/15.jpg)
21
Basics: Manipulating Data
Creation Extraction (subset) Union (merge) Deletion
SubscriptLinearLogical()sub2indind2sub…
![Page 16: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/16.jpg)
22
Basics: Manipulating Data
Creation Extraction (subset) Union (merge) Deletion
Subscript
<name>(row, col)<name>(row, col, …, z)
Indices may themselves be arrays.
![Page 17: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/17.jpg)
23
Basics: Manipulating Data
Creation Extraction (subset) Union (merge) Deletion
Linear
<name>(location)
Where <location> is:row+(col-1)*num_rows
Location may be an array.
![Page 18: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/18.jpg)
24
Basics: Manipulating Data
Creation Extraction (subset) Union (merge) Deletion
Logical
<name>(<logical_array>)
Where the dimensions of <name> and <logical_array> are the same and <logical_array> is of type logical.
![Page 19: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/19.jpg)
25
Basics: Manipulating Data
Creation Extraction (subset) Union (merge) Deletion
[]repmatstrvcatExpansioncathorzcatvertcat…
![Page 20: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/20.jpg)
26
Basics: Manipulating Data
Creation Extraction (subset) Union (merge) Deletion
clearclearvarsAssign to empty
![Page 21: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/21.jpg)
27
Basics: Manipulating Data
() versus []IndexingOrder of operationsArgument list
Matrix/Vector creationConcatenationMultiple outputs
![Page 22: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/22.jpg)
28
Basics: Manipulating Data
:1:50:5:2525:-3:225:5:00:.5:4
![Page 23: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/23.jpg)
29
Basics: Manipulating Data
enda(1:end)b(end, end)
![Page 24: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/24.jpg)
31
Basics: Math
Matrix operations>> a = [1 2; 3 4]
>> b = [5 6; 7 8]
>> c = a*b
Element operations (dot)>> a = [1 2; 3 4]
>> b = [5 6; 7 8]
>> c = a.*b
>> d = a.^3 + b^2
Others^ - Power\ - Left divide' - Transpose
![Page 25: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/25.jpg)
32
Basics: Math
Scalar expansion>> a = [1 2; 3 4]
>> a+[1 2]
>> a+1
What happens?
![Page 26: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/26.jpg)
33
Demo
Compute y = sin(2t) + cos(t) where t is from 1 to 10 seconds.
MATLAB Functions– sin
– cos
– plot
![Page 27: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/27.jpg)
34
MATLAB Functions
![Page 28: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/28.jpg)
35
Calling Functions
Function calling syntax:[out1, out2, ..., outN] = functionname(in1, in2, ..., inN)
Aside - Command syntax:functionname string1 string2 string3 … stringN
Revisit the Help.
![Page 29: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/29.jpg)
36
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB
![Page 30: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/30.jpg)
38
Consider one – Global Warming!
![Page 31: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/31.jpg)
39
Is the temperature rising? Climatic Research Unit
– School of Environmental Sciences at University of East Anglia, Norwich, UK
– http://www.cru.uea.ac.uk/
Importing data– Data set for land/sea combined temperature
anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat)
Visualizing data– Different methods to plot and observe data
Analyzing data– Computational analysis to check if temperature
is rising?
![Page 32: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/32.jpg)
40
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB
![Page 33: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/33.jpg)
41
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB Import/Extract/Export
Visualize
Analyze
![Page 34: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/34.jpg)
42
Explore and Discover
Automate
Access
Technical Computing WorkflowShare
![Page 35: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/35.jpg)
43
Explore and Discover
Automate
Access
Technical Computing Workflow: AccessShare
File
s • File->Import Data
• uiimport• importdata• csvread• xlsread• aviread• wavread• fread• fscanf• load/save• doc fileformats
• …
Sof
twar
e • COM/.NET• Java• C/C++• SOAP/WSDL• Database• OPC• ftp• urlread• …
Har
dwar
e • Data Acquisition• Instrument
Control• TCP/IP• Serial• Image
Acquisition• …
![Page 36: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/36.jpg)
47
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB Writing MATLAB programs
Programming logic control
![Page 37: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/37.jpg)
48
Writing MATLAB Programs
Using MATLAB Editor
Executing MATLAB script
Reusing MATLAB programs
![Page 38: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/38.jpg)
49
MATLAB Program Files
Why?– Automating– Editing/Debugging– Deploying as applications
MATLAB FunctionsMATLAB Scripts
![Page 39: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/39.jpg)
50
Basics of a MATLAB Program File
function [y1, y2] = functionName(x1,x2,…)
>> help fact
Compute a factorial value. H1 line
FACT(N) returns the factorial of N, Help text
usually denoted by N!
>> fact(3)
ans =
6
![Page 40: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/40.jpg)
51
ExerciseWrite Function definition for isTriangle.mGiven 3 lengths, Is (sum of 2 sides)> 3rd side? Is it Scalene, Isosceles or Equilateral?What is the area of triangle, if exists?
![Page 41: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/41.jpg)
52
Types of Functions
Primary MATLAB-file Functions
![Page 42: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/42.jpg)
53
Types of Functions
Primary MATLAB-file Functions Subfunctions
![Page 43: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/43.jpg)
54
Types of Functions
Primary MATLAB-file Functions Subfunctions Nested Functions
![Page 44: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/44.jpg)
55
Types of Functions
Primary MATLAB-file Functions Subfunctions Nested Functions
Anonymous Functions Overloaded Functions Private Functions
![Page 45: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/45.jpg)
56
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB Import/Extract/Export
Visualize
Analyze
![Page 46: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/46.jpg)
57
Explore and Discover
Automate
Access
Technical Computing WorkflowShare
![Page 47: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/47.jpg)
58
Visualization Tools
2-d plots 3-d plots
![Page 48: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/48.jpg)
59
Plotting Tools>> x = [0:0.2:20];>> y = sin(x).sqrt(x+1); >> y(2,:) = sin(x/2).sqrt(x+1);>> y(3,:) = sin(x/3).sqrt(x+1);
>> plot(x,y);
![Page 49: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/49.jpg)
61
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB Import/Extract/Export
Visualize
Analyze
![Page 50: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/50.jpg)
62
Processing and Analyzing Data
Data Analysis functions in MATLAB– Statistics
cov , max, mean, median, std
– Filtering and Convolution conv, deconv, filter, filter2
– Interpolation and Regression interp1, interpn, mldivide,
– Fourier Transforms fft, fftn, fftshift, ifft, umwrap
– Derivatives and Integrals del2, diff, gradient, polyint, trapz
Basic Operations
polyfit, polyval
![Page 51: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/51.jpg)
65
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB Writing MATLAB programs
Programming logic control
![Page 52: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/52.jpg)
66
Outline
MATLAB Desktop
Computing in MATLAB
Problem Solving with MATLAB
Working with data in MATLAB
Programming in MATLAB Writing MATLAB programs
Programming logic control
![Page 53: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/53.jpg)
67
Program Control Statements
Conditional Control– if/elseif/if, switch/case
Loop Control– while, for, break
Error Control– try, catch
![Page 54: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/54.jpg)
68
Conditional Control Statements
if, elseif and else
switch, case and otherwise
![Page 55: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/55.jpg)
69
Loop Control Statements
while (Conditional Loop)
for (Iterative Loop)
continue, break
![Page 56: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/56.jpg)
72
Explore and Discover
Automate
Access
Technical Computing WorkflowShare
![Page 57: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/57.jpg)
74
Surface and Mesh plots– peaks, surf, mesh, meshgrid
– colorbar, colormap, shading
View Control– campos, view, daspect, rotate3d
Lighting and Transparency– camlight, diffuse, alpha
Volume Visualization– curl, isosurface, slice
3-D Visualization Features
![Page 58: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/58.jpg)
75
Object-Oriented Programming
![Page 59: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/59.jpg)
76
External Interfaces
Shared libraries (.dll, .so, .dylib) C, Fortran interface C, Fortran MEX-files (.mex) Sun Java classes COM/.NET support Web services Serial Port I/O
![Page 60: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/60.jpg)
77
More on MATLAB
MATLAB Tutorials
Demos and Webinars
Documentation
MATLAB Central(User Community)
![Page 61: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/61.jpg)
78
Training Tutorials
![Page 62: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/62.jpg)
79
Training Tutorials
![Page 63: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/63.jpg)
80
Training Tutorials
MATLAB
Simulink
Control Systems
Signal Processing
![Page 64: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/64.jpg)
82
Demos
![Page 65: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/65.jpg)
83
Demos
![Page 66: Introduction to MATLAB - utoledo.eduwolson/mime3380/Lecture 6...Importing data – Data set for land/sea combined temperature anomalies on a 5 by 5 grid-box basis (HadCRUT3.mat) Visualizing](https://reader034.vdocument.in/reader034/viewer/2022042307/5ed324f60d4fd07a4b18f552/html5/thumbnails/66.jpg)
85
Summary
MATLAB is a high level-language for technical computing
Interactive tool with mathematical and graphical functions
MATLAB provides features to access, compute, analyze and visualize data
MATLAB also provides capabilities to interface with external languages