Tutorial Program. 1. Basics

Similar documents
Beginner s Matlab Tutorial

MATLAB Functions. function [Out_1,Out_2,,Out_N] = function_name(in_1,in_2,,in_m)

Introduction to Matlab

Chapter 07: Instruction Level Parallelism VLIW, Vector, Array and Multithreaded Processors. Lesson 05: Array Processors

Financial Econometrics MFE MATLAB Introduction. Kevin Sheppard University of Oxford

Introduction to MATLAB (Basics) Reference from: Azernikov Sergei

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Department of Chemical Engineering ChE-101: Approaches to Chemical Engineering Problem Solving MATLAB Tutorial VI

Matrix Indexing in MATLAB

Simple Programming in MATLAB. Plotting a graph using MATLAB involves three steps:

2+2 Just type and press enter and the answer comes up ans = 4

AMATH 352 Lecture 3 MATLAB Tutorial Starting MATLAB Entering Variables

Computational Mathematics with Python

Computational Mathematics with Python

GINI-Coefficient and GOZINTO-Graph (Workshop) (Two economic applications of secondary school mathematics)

2 Describing, Exploring, and

MATLAB Tutorial. Chapter 6. Writing and calling functions

Solving Systems of Linear Equations Using Matrices

MATLAB: Structures and Cell Arrays

Introduction. Chapter 1

Scientific Programming in Python

1 Organizing time series in Matlab structures

Numerical Methods in MATLAB

Basics of STATA. 1 Data les. 2 Loading data into STATA

BOOLEAN ALGEBRA & LOGIC GATES

Basic Concepts in Matlab

CD-ROM Appendix E: Matlab

Appendix 4 Simulation software for neuronal network models

(!' ) "' # "*# "!(!' +,

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Appendix: Tutorial Introduction to MATLAB

Decadal/Interdecadal variations in ENSO predictability in a hybrid coupled model from

FOPR-I1O23 - Fundamentals of Programming

Part #3. AE0B17MTB Matlab. Pavel Valtr Miloslav Čapek, Filip Kozák, Viktor Adler

CHARTS AND GRAPHS INTRODUCTION USING SPSS TO DRAW GRAPHS SPSS GRAPH OPTIONS CAG08

Programming Exercise 3: Multi-class Classification and Neural Networks

Einführung in MATLAB Sommer Campus 2004

Analysis of System Performance IN2072 Chapter M Matlab Tutorial

Euler s Method and Functions

u = [ 2 4 5] has one row with three components (a 3 v = [2 4 5] has three rows separated by semicolons (a 3 w = 2:5 generates the row vector w = [ 2 3

From The Little SAS Book, Fifth Edition. Full book available for purchase here.

This presentation explains how to monitor memory consumption of DataStage processes during run time.

EXCEL SOLVER TUTORIAL

Introduction to Querying & Reporting with SQL Server

Summary: Transformations. Lecture 14 Parameter Estimation Readings T&V Sec Parameter Estimation: Fitting Geometric Models

MATLAB and Big Data: Illustrative Example

Bayesian Machine Learning (ML): Modeling And Inference in Big Data. Zhuhua Cai Google, Rice University

2x + y = 3. Since the second equation is precisely the same as the first equation, it is enough to find x and y satisfying the system

Using Your TI-89 in Elementary Statistics

WEEK #3, Lecture 1: Sparse Systems, MATLAB Graphics

Character strings and. Lab tutor : Dennis Yang LIU csygliu@comp.polyu.edu.hk Lab 5 : Oct. 16, 2014

Running a Load Flow Analysis

1 Topic. 2 Scilab. 2.1 What is Scilab?

Question 2: How do you solve a matrix equation using the matrix inverse?

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

Computational Mathematics with Python

Module 3: Correlation and Covariance

Computación I: intro to Matlab. Francesca Maria Marchetti

KNIME TUTORIAL. Anna Monreale KDD-Lab, University of Pisa

Cooling and Euler's Method

An Incomplete C++ Primer. University of Wyoming MA 5310

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.

Introduction to MATLAB Gergely Somlay Application Engineer

Introduction to Modern Data Acquisition with LabVIEW and MATLAB. By Matt Hollingsworth

Lab 1. The Fourier Transform

2.2/2.3 - Solving Systems of Linear Equations

We shall turn our attention to solving linear systems of equations. Ax = b

General Framework for an Iterative Solution of Ax b. Jacobi s Method

(!' ) "' # "*# "!(!' +,

Use of Technology in Teaching the Mathematics of Linear Algebra

Database Programming with PL/SQL: Learning Objectives

Using MATLAB to Measure the Diameter of an Object within an Image

Digital Imaging and Multimedia. Filters. Ahmed Elgammal Dept. of Computer Science Rutgers University

5: Magnitude 6: Convert to Polar 7: Convert to Rectangular

LAYOUT OF THE KEYBOARD

Signal Processing First Lab 01: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization.

1 Description of The Simpletron

18.06 Problem Set 4 Solution Due Wednesday, 11 March 2009 at 4 pm in Total: 175 points.

MATLAB DFS. Interface Library. User Guide

What is a Loop? Pretest Loops in C++ Types of Loop Testing. Count-controlled loops. Loops can be...

Data Analysis with MATLAB The MathWorks, Inc. 1

Introduction to MATLAB for Data Analysis and Visualization

PowerWorld Simulator

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0

with functions, expressions and equations which follow in units 3 and 4.

SOLVING LINEAR SYSTEMS

CS1112 Spring 2014 Project 4. Objectives. 3 Pixelation for Identity Protection. due Thursday, 3/27, at 11pm

Bachelor of Games and Virtual Worlds (Programming) Subject and Course Summaries

Package SHELF. February 5, 2016

Programming Languages & Tools

DAQ in MATLAB HANS-PETTER HALVORSEN,

SAS R IML (Introduction at the Master s Level)

DEPARTMENT OF PSYCHOLOGY UNIVERSITY OF LANCASTER MSC IN PSYCHOLOGICAL RESEARCH METHODS ANALYSING AND INTERPRETING DATA 2 PART 1 WEEK 9

MATLAB Programming. Problem 1: Sequential

MATLAB Basics MATLAB numbers and numeric formats

Chapter 2. Point transformation. Look up Table (LUT) Fundamentals of Image processing

CHAPTER 3. INTRODUCTION TO MATRIX METHODS FOR STRUCTURAL ANALYSIS

imc FAMOS 6.3 visualization signal analysis data processing test reporting Comprehensive data analysis and documentation imc productive testing

Data exploration with Microsoft Excel: analysing more than one variable

How To Use A High Definition Oscilloscope

Transcription:

1. Basics Working environment Dealing with matrices Useful functions Logical operators Saving and loading Data management Exercises 2. Programming Basics graphics settings - ex Functions & scripts Vectorization Exercises 3. Applications Generic scripts Means Anomalies STD Correlations Time series: SOI SSTA detrending filtering Interpolation EOFs REOFs CEOFs Spectral analysis Wavelet day 1 day 2 days 3, 4 & 5 Tutorial Program B.Aires, 20-24/02/06 Centro de Investigaciones del Mar y la Atmosfera and Department of Atmospheric and Oceanic Sciences 1 (UBA) E.Scoccimarro, A.F.Carril

edit the exe-5 graphic settings : Programming script functions 2

functions & scripts : MATLAB & Practical Applications Programming Matlab allows commands to be executed in two ways: Interactive You can type commands directly to Matlab, allowing you to proceed through a computation step-by-step, inspecting variables, and plotting intermediate results. Program By creating a file of commands, a sequence of commands can be stored and executed as if each were typed in interactive mode. The file, created in an ordinary editor or by Matlab, should be named.m. It is executed by typing its name without the '.m'. A Program can be a script or a function. 3

.. simple script : MATLAB & Practical Applications Programming >> edit simple_script.m 4

functions & scripts : MATLAB & Practical Applications Programming A function is a script that contains function on the first line function [avgy] = runavg ( y, len) A function can be called from command line, >> avgy = runavg (y, len); FUNCTION output inputs or by using others functions or scripts. 5

function call: MATLAB & Practical Applications Programming No memory of the internal variables, used by the function. 6

Programming functions with dynamic number of inputs: How to use varargin. 7

Programming Built-in functions: Functions that are frequently used or that can take more time to execute are often implemented as executable files. These functions are called built-ins. Unlike M-file functions, you cannot see the source code for built-ins. As with M-file functions, you can identify which functions are built-ins using the exist function. This function identifies built-ins by returning the number 5: >> exist max ans = 5 Or trying to edit it: for built-in function you will get only help info. 8

Indexing Subscripted Indexing: Linear Indexing: A C B rows column D 9

Indexing Two new functions: IND2SUB: SUB2IND: Multiple subscripts from linear index. Linear index from multiple subscripts. >> [ i, j, k ] = ind2sub ( size (A), 16 ) i = 1 j = 2 k = 2 >> ind = sub2ind ( size (A), i, j, k ) ind = 16 10

Indexing Logical Indexing: E With logical, or Boolean, indexing, the index parameter is a logical matrix that is the same size as A and contains only 0's and 1's. The elements of A that are selected have a '1' in the corresponding position of the logical indexing matrix. 11

Indexing Logical Indexing example: How to use logical indexing power of MATLAB to remove negative values in a series. 12

Vectorization Let s talk about things that can be done in parallel.. 13

Vectorization Matrix Functions of Two Vectors: To evaluate a function F of two variables: F(x,y) = x * exp ( -x 2 y 2 ) for yi=1:16 for xi=1:21 f(yi,xi) = x(xi).* exp (-x(xi).^2 - y(yi).^2); end end 14

Exercises Exe 5: Read nino3 SSTA series in binary format, plot and save the image. DONE Exe 6: Vectorizing loops: 6a. vectorizing a double FOR loop. 6b. vectorizing code that finds the cumulative sum of a vector every fifth element. (need cumsum function) 6c. Create a code that repeats a vector value when the following value is 0. Exe 7: Read an SST field and plot global mapping in different projections. (starting from the Exe 3 [day 1]) Exe 8: Create Scatter Plots. Some info about subplotting and page layout settings. B.Aires, 20-24/02/06 Centro de Investigaciones del Mar y la Atmosfera and Department of Atmospheric and Oceanic Sciences (UBA) E.Scoccimarro, A.F.Carril 15