Matlab for Scientific Programming A Brief Introduction Mark Levene Follow the links to learn more! Many features will be demonstrated.

Slides:



Advertisements
Similar presentations
Algorithms and applications
Advertisements

MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
3D Geometry for Computer Graphics
Introduction to MATLAB The language of Technical Computing.
Introduction to Matlab Workshop Matthew Johnson, Economics October 17, /13/20151.
Dimensionality Reduction PCA -- SVD
15-826: Multimedia Databases and Data Mining
MATLAB Lecture Two (Part II) Thursday/Friday, July 2003.
MATLAB Presented By: Nathalie Tacconi Presented By: Nathalie Tacconi Originally Prepared By: Sheridan Saint-Michel Originally Prepared By: Sheridan Saint-Michel.
Mx? A programming language for scientific computation. Related Languages: Matlab IDL Maple, Mathcad, Mathematica.
The Terms that You Have to Know! Basis, Linear independent, Orthogonal Column space, Row space, Rank Linear combination Linear transformation Inner product.
3D Geometry for Computer Graphics
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
Ordinary least squares regression (OLS)
By. What advantages has it? The Reasons for Choosing Python  Python is free  It is object-oriented  It is interpreted  It is operating-system independent.
© 2004 The MathWorks, Inc. 1 MATLAB for C/C++ Programmers Support your C/C++ development using MATLAB’s prebuilt graphics functions and trusted numerics.
Chapter 2 Dimensionality Reduction. Linear Methods
Presented By Wanchen Lu 2/25/2013
Chapter 5. Loops are common in most programming languages Plus side: Are very fast (in other languages) & easy to understand Negative side: Require a.
Martin Ellison University of Warwick and CEPR Bank of England, December 2005 Introduction to MATLAB.
Introduction to MATLAB adapted from Dr. Rolf Lakaemper.
MATLAB Tutorials Session I Introduction to MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU.
INTRODUCTION FOR PERL MONGERS MATLAB. Outline 1. Matlab, what is it good for 2. Matlab’s IDE & functions 3. A few words about Maple 4. What needs to be.
Non Negative Matrix Factorization
Review of Matrices Or A Fast Introduction.
Using MathCAD SCC Spring-08 Electronic Technology Wang Ng x-2638
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
CMPS 1371 Introduction to Computing for Engineers MATRICES.
Analytical Toolbox Differential calculus By Dr J.P.M. Whitty.
Introduction To this point MATLAB has been used to answer questions with a numeric value ▫Variables are assigned specific values ▫Answers are numbers MATLAB.
MATLAB Harri Saarnisaari, Part of Simulations and Tools for Telecommunication Course.
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28: Principal Component Analysis; Latent Semantic Analysis.
Introduction to MATLAB adapted from Dr. Rolf Lakaemper.
Introduction to MATLAB Session 1 Simopekka Vänskä, THL 2010.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Chapter 7 Multivariate techniques with text Parallel embedded system design lab 이청용.
Gene Clustering by Latent Semantic Indexing of MEDLINE Abstracts Ramin Homayouni, Kevin Heinrich, Lai Wei, and Michael W. Berry University of Tennessee.
Introduction Examples of differential equations and related problems Analytical versus numerical solutions Ideas of numerical representations of solutions.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Introduction Course Outline.
Chapter 1: Brief Overview of MATLAB MATLAB for Scientist and Engineers Using Symbolic Toolbox.
Recap Saving Plots Summary of Chapter 5 Introduction of Chapter 6.
Introduction to GAMS, Netlib, Numerical Recipes CS 3414.
MATLAB – PT1 The purpose of this workshop is to get you started and to have fun with MATLAB! Let’s talk a little and decide on what we will be covering.
Introduction to Linear Algebra Mark Goldman Emily Mackevicius.
1 Beginning & Intermediate Algebra – Math 103 Math, Statistics & Physics.
EIGENSYSTEMS, SVD, PCA Big Data Seminar, Dedi Gadot, December 14 th, 2014.
ME 142 Engineering Computation I Exam 3 Review Mathematica.
CIS 601 Fall 2003 Introduction to MATLAB Longin Jan Latecki Based on the lectures of Rolf Lakaemper and David Young.
CMU SCS : Multimedia Databases and Data Mining Lecture #18: SVD - part I (definitions) C. Faloutsos.
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Recap Functions with No input OR No output Determining The Number of Input and Output Arguments Local Variables Global Variables Creating ToolBox of Functions.
Jeff Howbert Introduction to Machine Learning Winter Machine Learning MATLAB Essentials.
Lecture Note 1 – Linear Algebra Shuaiqiang Wang Department of CS & IS University of Jyväskylä
CIS 595 MATLAB First Impressions. MATLAB This introduction will give Some basic ideas Main advantages and drawbacks compared to other languages.
1 Statistics & R, TiP, 2011/12 Multivariate Methods  Multivariate data  Data display  Principal component analysis Unsupervised learning technique 
“Moh’d Sami” AshhabSummer 2008University of Jordan MATLAB By (Mohammed Sami) Ashhab University of Jordan Summer 2008.
Building Comfort With MATLAB
Introduction to Matlab
Built-in MATLAB Functions Chapter 3
Introduction to MATLAB
INTRODUCTION TO BASIC MATLAB
(Mohammed Sami) Ashhab
Introduction to MATLAB
Regression Analysis Jared Dean as quoted in Big Data, Data Mining, and Machine Learning From my experience, regression is the most dominant force in driving.
Chapter 1 Introduction(1.1)
SVD, PCA, AND THE NFL By: Andrew Zachary.
Introduction to MATLAB
Simulation And Modeling
Introduction to Matlab
Presentation transcript:

Matlab for Scientific Programming A Brief Introduction Mark Levene Follow the links to learn more! Many features will be demonstrated

What can we achieve in 3 hours? Demonstration of why you may consider to use Matlab and for what types of tasks. Tips on getting you started as a Matlab programmer. You will need to practice Malab at home, and/or when doing a project for which Matlab may be suitable.

Matlab Resources There are many!! Matlab tutorials and learning resources Attaway, MATLAB A Practical Introduction to Programming and Problem Solving, Second Edition, Elsevier, 2012 (Introductory). Banches, Text Mining with Matlab, Springer, 2012 (Intermediate). Martinez et al., Exploratory Data Analysis with Matlab, Second Edition, CRC Press, 2011(Advanced). Matlab claims over 1 million users world wide in 2012!! There are many Matlab books.Matlab books Also see Matlab documentation centre.Matlab documentation centre

Why Matlab? Introductory Example Example5_2 from Martinez – load iris 3 classes of Iris to be distinguished by –sepal length, sepal width –petal length, petal width Look at the “data” Briefly discuss the kmeans algorithm for grouping data into k groups (here k=3); demonstrate help in Matlab

What can you do in Matlab? The normal things you can do in any other programming languages, but is interpreted and not strict in its typing to allow quick prototyping. Has many built-in features to handle matrices, maths & stats, data analysis and plotting. Has a wide range of toolboxes such as curve fitting, neural networks, bioinformatics, symbolic maths and finance.toolboxes Although Matlab is proprietary there are many open source toolboxes; see Matlab central.Matlab central

A simple function in Matlab function area = conearea(radius, height) area = pi/3 * radius^2 * height; end conearea(4,6.1)  ans = Matlab has the usual control flow that other languages have – use help when needed !!

Vectorised code Chapter 5 in Attaway for i=1:10 v(i) = i; end %create a vector v = 1:1:10 %start=1, increment=1,end=10 for i=1:10 w(i) = w(i)^2; end %standard loop w=w.^2; %vectorised code Can use any other vector operations! w=log(v); %a vector can be an argument Can query a vector using find: find(w>5); %returns indices satisfying condition

Matrices and Linear Algebra Chapter 12 in Attaway Can also vectorise (try it out yourselves!) m = rand(3,3); %create a random 3x3 matrix Matrix operations work as expected! n = m.*m %Matrix multiplication You will need to revise your linear algebra to make use of these Matlab features.

Example SVD and PCA (Eigenvector decomposition) For example Singular Value Decomposition (SVD) – Look this up for maths details, SVD has applications in many areas including Information Retrieval is easy in Matlab. m = rand(100,10); svd(m); Principal Components Analysis (PCA) is a special case of SVD measuring the directions along which the variance is maximised. load filteredyeastdata; mapcaplot(yeastvalues, genes);

Basic Statistics Chapter 13 in Attaway x= [8 9 3; ; ]; mean(x)  ans = var(x)  ans = std(x)  ans = y = [ ]; mode(y)  ans = 10 median(y)  ans = 9 There is much more in the statistics toolbox

Curve fitting Example7_3 in Martinez Demonstrate cftool with (x,x) and (x,y) Example 9_2 in Martinez Demonstrate histogram Demonstrate cftool with (xk,nuk) normfit = [33,40,42,41,39,32]; linfit = [2,44,49,61,82,95]

Maths Chapter 15 in Attaway Symbolic maths syms x y f = x^2 + y^2 + 2*x*y simplify(f)  ans = (x + y)^2 expand(ans)  f ezplot(x^2+2*x+2) % plot the function

Solving equations solve(2*x^2+x-6)  ans = -2 3/2 syms x a b c solve(a*x^2+b*x+c)  ans = -(b + (b^2 - 4*a*c)^(1/2))/(2*a) -(b - (b^2 - 4*a*c)^(1/2))/(2*a) Can try and solve more complex equations solve(exp(x)-3)  ans = log(3)

Calculus syms x diff(x^3,x)  ans = 3*x^2 %differentiation int(3*x^2)  ans = x^3 %integration Can do much more, including solving differential equations. Do not worry about the Maths as such, as in Matlab we pick up the tools as and when we need them.

Summary Matlab provides and easy-to-use, state-of-the- art environment for scientific computing. There are a wide variety of toolboxes for different applications, many of which are open source. Matlab may not always be the most efficient solution but it is great for quick prototyping. Matlab is not designed for general purpose programming, although it is a complete language.