MATLAB Programming Tricks
|
|
|
- Magnus Lamb
- 10 years ago
- Views:
Transcription
1 MATLAB Programming Tricks Retreat 2015 Bad Überkingen Dominic Mai
2 Why use MATLAB? Easy to write code - No type declarations needed - Memory management handled automatically - Structs for easy data keeping - Duck typing Built in nd-arrays - Matrix-Vector arithmetic, linear algebra Lots of stuff available - Toolboxes (40+) - Matlabcentral - Interfaces to many 3rd party tools written in other languages: ANN, libsvm, LBFGS, Caffe,LSA TR, opencv, Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 2
3 Why use MATLAB? Easy to debug - Interpreted language with interactive workspace MEX C/C++ interface Profiler Easy to generate nice looking plots Well documented 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 3
4 Downsides? Not free Interpreted language - Function calls and loops are (sometimes) relatively slow Vectorization (getting rid of loops) - Often not straight forward - Probably needs more memory Passing arguments to functions: Call by value - It's actually copy on write - there are ways around ( mex, global) 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 4
5 Overview Array Memory Layout Image Transformations Random Stuff 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 5
6 ND Arrays: memory arrangement MATLAB supports nd-arrays of arbitrary dimensions - Need continuous chunk of memory - Stored column major 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 6
7 ND Arrays: creationism Nested loops %fill up with nested for loop c = 1; for i3 = 1:3 for i2 = 1:2 for i1 = 1:4 A(i1,i2,i3) = c; c=c+1; end end end 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 7
8 ND Array - creationism Linear element access %linear element access A = zeros([4,2,3]);%allocate & def. shape for i = 1:numel(A) A(i) = i; end 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 8
9 ND Array - creationism Concatenation p1 = [ ; ]'; p2 = [9:12; 13:16]'; p3 = [17 21;18 22;19 23;20 24]; A = cat(3,p1,p2,p3); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 9
10 ND Array - creationism reshape - Fills along fastest moving dimension clear A; A = reshape(1:24,[4,2,3]); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 10
11 Nd Array element access 500³ elements: sum up - Different nested loops - 3 dimensions: how many ways are there? acc = 0; t = tic; for i3 = 1:N for i2 = 1:N for i1 = 1:N acc = acc + A(i1,i2,i3); end end end d = toc(t); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 11
12 Nd Array element access Linear access t = tic; for i = 1:numel(A) acc= acc+a(i); end d = toc(t); Vectorized (i.e. no loops) %v1: on flattened array acc = 0; t = tic; acc= sum(a(:)); d = toc(t); %v2: every sum reduces dim by 1 t = tic; acc= sum(sum(sum(a))); d = toc(t); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 12
13 Nd Array element access Different nested loops, 500³ elements 0.06s 0.03s 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 13
14 Nd Array element access Number of adjacent elements in memory 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 14
15 Nd Array element access: eval Create parameterizable code with eval str= [ 't=tic;',... 'acc=0; ',... 'for i%i=1:n ',... 'for i%i=1:n ',... 'for i%i=1:n ',... 'acc=acc+a(i1,i2,i3); ',... 'end; ',... 'end; ',... 'end; ',... 'd = toc(t);']; 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 15
16 Nd Array element access: eval Create parameterizable code p = perms([1 2 3]); for i = 1:size(p,1) a = p(i,:); cmd = sprintf(str, a(1), a(2), a(3)); eval(cmd); end perms([1 2 3]) ans: Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 16
17 Nd Array element access: eval Create parameterizable code - But: does not support JIT acceleration! 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 17
18 JIT acceleration Accelerates code (I guess mostly loops) - Not well documented, can leed to strange behavior function test1 tic; a = 2; for i = 1: a = a* ; end toc; a = 1:2; function test2 tic; a = 2; for i = 1: a = a* ; end toc; c = 1:10; 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 18
19 JIT acceleration Accelerates code (I guess mostly loops) - Avoid reassignment function test1 tic; a = 2; for i = 1: a = a* ; end toc; a = 1:2; function test2 tic; a = 2; for i = 1: a = a* ; end toc; c = 1:10; 2.31s 0.06s ~40x faster! 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 19
20 Alternative to eval Useful for creating scripts - Uses JIT - Globally mounted home: ssh + screen matlabexec = 'matlab -nodesktop -nosplash -r "%s; quit force"'; cmd = sprintf(matlabexec, ml_cmd); system(cmd); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 20
21 Overview Array Memory Layout Image Transformations - Gray value - Coordinate Random Stuff 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 21
22 Vectorization: Matrix Mult Multiply all 3-vectors of a [MxNx3] with a [3x3] matrix - Example: colorspace transformation im = single(imread('cat_sir.jpg')); %size: [631,553,3] im = im / max(im(:)); %rgb to xyz M = [ ; ; ]; %naive: for loops tic; for i1 = 1:size(im,1) for i2 = 1:size(im,2) im(i1,i2,:) = M*squeeze(im(i1,i2,:)); end end toc; 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 22
23 Vectorization: Matrix Mult Multiply all 3-vectors of a [MxNx3] with a [3x3] matrix - Use shiftdim & reshape to form a 2d matrix suitable for matrix multiplication: im = shiftdim(im,2); shape = size(im);%[3,631,553] %create a 2D matrix of col vectors im = reshape(im, 3,[]);%[3, 631*553] im= M*im; %reshape to original im = shiftdim(reshape(im, shape),1);%[631,553,3] Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 23
24 Vectorization: Matrix Mult Multiply all 3-vectors of a [MxNx3] with a [3x3] matrix - equally fast: channel by channel 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 24
25 Vectorization: Matrix Mult Timings - For loops: Shiftdim & Reshape: Channel wise: Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 25
26 Overview Array Memory Layout Image Transformations - Gray value - Coordinate Random Stuff 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 26
27 Patch-extract: interpn, ndgrid (linear) Transformations to extract an image patch source target 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 27
28 Patch-extract: interpn, ndgrid (linear) Transformations to extract an image patch 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 28
29 Patch-extract: interpn, ndgrid (linear) Transformations to extract an image patch 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 29
30 Patch-extract: interpn, ndgrid (linear) Transformations to extract an image patch %to origin M1 = [ 1 0 -y; 0 1 -x; 0 0 1]; %origin to center of target M2 = [ 1 0 target_size(1)/2; 0 1 target_size(2)/2; 0 0 1]; 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 30
31 Patch-extract: interpn, ndgrid Ndgrid: create grid indices for arbitrary dimensions [X,Y] = ndgrid(1:3,1:4) X: Y: Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 31
32 Patch-extract: interpn, ndgrid Putting stuff together %get inverse transformation M = pinv(m2*m1); %create grid [X,Y] = ndgrid(1:target_size(1), 1:target_size(2)); %apply transformation XT = M(1,1)*X + M(1,2)*Y + M(1,3); YT = M(2,1)*X + M(2,2)*Y + M(2,3); %read out source with interpolation target = zeros([target_size, size(im,3)]); for ch = 1:size(im,3) target(:,:,ch) = interpn(im(:,:,ch), XT, YT, 'bicubic',0); end 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 32
33 Patch-extract: interpn, ndgrid Adding Rotations R = [ cos(alpha), -sin(alpha), 0; sin(alpha), cos(alpha), 0; 0, 0, 1]; M = pinv(m2*r*m1); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 33
34 Patch-extract: interpn, ndgrid Border treatment: mirroring Artifacts due to Screencapture / libre office %mirror? XT(XT < 1) = 2 - XT(XT < 1); YT(YT < 1) = 2 - YT(YT < 1); XT(XT > size(im,1)) = 2*size(im,1) - XT( XT > size(im,1)); YT(YT > size(im,2)) = 2*size(im,2) - YT( YT > size(im,2)); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 34
35 Patch-extract: interpn, ndgrid Adding wobble %wobble u = randn(3,3); v = randn(3,3); U = imresize(u,size(x),'bicubic'); V = imresize(v,size(x),'bicubic'); % put all together XT = M(1,1)*X + M(1,2)*Y + M(1,3) + wobble * U; YT = M(2,1)*X + M(2,2)*Y + M(2,3) + wobble * V; 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 35
36 Overview Array Memory Layout Image Transformations Random Stuff 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 36
37 Startup.m Automatically load config file on startup.bashrc: - MATLABPATH=$MATLABPATH:/path/to/startup.m/ Startup.m: %add all paths recursively that are rooted here if(~isdeployed) addpath(genpath('/home/maid/phd/trunk/matlab/')); else disp('in deployed mode.'); end %load standard- config file: generative model detection global config; s = '/home/maid/phd/trunk/matlab/config.mat'; load(s); fprintf('loaded global config from %s\n',s); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 37
38 Global: config config = CROSSVALIDATION: 1 CVALS: [1x12 double] servers: {'dacky' 'frieda' 'william'} numjobs: [ ] verbose: 0 filelocation: '/home/maid/phd/trunk/matlab/config.mat' debug: 0 trainingbasefolder:'/pathto/somefolder/' recomputefeatures: Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 38
39 Distribute values to struct %declare anonymous functions cellexpand x{:}; numexpand cellexpand(num2cell(x)); clear udets; %init struct, all accepted = 0 [udets(1:1000).accepted] = deal(0); %distribute array to struct [udets.id] = numexpand(1:1000); udets(1): accepted: 0 id: 1 udets(2): accepted: 0 id: 2 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 39
40 Standard function arguments function res = tut_varargin(a1,a2, varargin) %std. values optargs = {eps, %replace std. values optargs(1:length(varargin)) = varargin; %give nicer variable names [tol, its, init_func] = optargs{:}; 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 40
41 combvec & bsxfun Create corners of a cuboidal box shape = [120, 80, 90]'; corners = bsxfun(@times, shape,... combvec([1,0], [1,0], [1,0])) corners: combvec([1,0], [1,0], [1,0]) ans: Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 41
42 cell argument lists Cell expansion using {:} - Generate arbitrary long list of arguments - Does not need to be of uniform type %cell-argument list c = repmat({[0 1]},1,3); %c: 1x3 cell res = combvec(c{:}); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 42
43 ismember Pick out a subset %pick out a subset: ismember [dets(1:100).ch] = numexpand(randi(10,1,100)); subset = dets(ismember([dets.ch], [1,4,5])); [subset.ch] ans: Columns 1 through Columns 22 through Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 43
44 histc Count occurences %count occurences count = histc([dets.ch], unique([dets.ch])); unique([dets.ch]): count: Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 44
45 Local maxima With morphological operations se = ones([mindist_x, mindist_y]); res = imdilate(data, se); lmax = find(data == res); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 45
46 Find Dependencies of.m files [flist, plist] = matlab.codetools.requiredfilesandproducts('getinvfield2.m') flist': '/home/maid/phd/trunk/matlab/3rdparty/ann_mwrapper/annquery.m' '/home/maid/phd/trunk/matlab/3rdparty/ann_mwrapper/private/ann_ mex.mexa64' '/home/maid/phd/trunk/matlab/3rdparty/ann_mwrapper/private/seto pts.m' '/home/maid/phd/trunk/matlab/3rdparty/ann_mwrapper/private/sho wdoc.m' '/home/maid/phd/trunk/matlab/helpers/getinvfield2.m' plist(1): Name: 'MATLAB' Version: '8.3' ProductNumber: 1 plist(2): Name: 'Image Processing Toolbox' Version: '9.0' ProductNumber: Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 46
47 JAVA integration Write Excel tables xlwrite--generate-xls-x--files-without-excel-onmac-linux-win sheet1 = {'col1', 'col2', 'col3'; 4 5 6; 'asdf' 4 'fgf'}; sheet2 = {'col1', 'col2', 'col3'; 4 5 6; 'asdf' 4 'fgf'}; xlwrite('tut_demo.xls', sheet1, 'page1'); xlwrite('tut_demo.xls', sheet2, 'Loss'); 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 47
48 JAVA integration Transparent variable conversion Java.awt.robot robot = java.awt.robot; robot.mousemove(x,y); robot.keypress(asciinum); dynamic-search-box/content/java_robot.m 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 48
49 Fin. 25.Aug Dominic Mai Uni Freiburg Retreat Bad ÜberkingenPräsentationstitel 49
CUDAMat: a CUDA-based matrix class for Python
Department of Computer Science 6 King s College Rd, Toronto University of Toronto M5S 3G4, Canada http://learning.cs.toronto.edu fax: +1 416 978 1455 November 25, 2009 UTML TR 2009 004 CUDAMat: a CUDA-based
Basic Concepts in Matlab
Basic Concepts in Matlab Michael G. Kay Fitts Dept. of Industrial and Systems Engineering North Carolina State University Raleigh, NC 769-7906, USA [email protected] September 00 Contents. The Matlab Environment.
Scientific Programming in Python
UCSD March 9, 2009 What is Python? Python in a very high level (scripting) language which has gained widespread popularity in recent years. It is: What is Python? Python in a very high level (scripting)
Introduction to Matlab
Introduction to Matlab Social Science Research Lab American University, Washington, D.C. Web. www.american.edu/provost/ctrl/pclabs.cfm Tel. x3862 Email. [email protected] Course Objective This course provides
Financial Econometrics MFE MATLAB Introduction. Kevin Sheppard University of Oxford
Financial Econometrics MFE MATLAB Introduction Kevin Sheppard University of Oxford October 21, 2013 2007-2013 Kevin Sheppard 2 Contents Introduction i 1 Getting Started 1 2 Basic Input and Operators 5
CS1112 Spring 2014 Project 4. Objectives. 3 Pixelation for Identity Protection. due Thursday, 3/27, at 11pm
CS1112 Spring 2014 Project 4 due Thursday, 3/27, at 11pm You must work either on your own or with one partner. If you work with a partner you must first register as a group in CMS and then submit your
Exercise 0. Although Python(x,y) comes already with a great variety of scientic Python packages, we might have to install additional dependencies:
Exercise 0 Deadline: None Computer Setup Windows Download Python(x,y) via http://code.google.com/p/pythonxy/wiki/downloads and install it. Make sure that before installation the installer does not complain
Programming Exercise 3: Multi-class Classification and Neural Networks
Programming Exercise 3: Multi-class Classification and Neural Networks Machine Learning November 4, 2011 Introduction In this exercise, you will implement one-vs-all logistic regression and neural networks
14:440:127 Introduction to Computers for Engineers. Notes for Lecture 06
14:440:127 Introduction to Computers for Engineers Notes for Lecture 06 Rutgers University, Spring 2010 Instructor- Blase E. Ur 1 Loop Examples 1.1 Example- Sum Primes Let s say we wanted to sum all 1,
An Introduction to Applied Mathematics: An Iterative Process
An Introduction to Applied Mathematics: An Iterative Process Applied mathematics seeks to make predictions about some topic such as weather prediction, future value of an investment, the speed of a falling
CRASH COURSE PYTHON. Het begint met een idee
CRASH COURSE PYTHON nr. Het begint met een idee This talk Not a programming course For data analysts, who want to learn Python For optimizers, who are fed up with Matlab 2 Python Scripting language expensive
AMATH 352 Lecture 3 MATLAB Tutorial Starting MATLAB Entering Variables
AMATH 352 Lecture 3 MATLAB Tutorial MATLAB (short for MATrix LABoratory) is a very useful piece of software for numerical analysis. It provides an environment for computation and the visualization. Learning
G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.
SQL databases An introduction AMP: Apache, mysql, PHP This installations installs the Apache webserver, the PHP scripting language, and the mysql database on your computer: Apache: runs in the background
Fast Arithmetic Coding (FastAC) Implementations
Fast Arithmetic Coding (FastAC) Implementations Amir Said 1 Introduction This document describes our fast implementations of arithmetic coding, which achieve optimal compression and higher throughput by
Engineering Problem Solving and Excel. EGN 1006 Introduction to Engineering
Engineering Problem Solving and Excel EGN 1006 Introduction to Engineering Mathematical Solution Procedures Commonly Used in Engineering Analysis Data Analysis Techniques (Statistics) Curve Fitting techniques
Tutorial Program. 1. Basics
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
Introduction to MATLAB (Basics) Reference from: Azernikov Sergei [email protected]
Introduction to MATLAB (Basics) Reference from: Azernikov Sergei [email protected] MATLAB Basics Where to get help? 1) In MATLAB s prompt type: help, lookfor,helpwin, helpdesk, demos. 2) On the
CHAPTER 1 Splines and B-splines an Introduction
CHAPTER 1 Splines and B-splines an Introduction In this first chapter, we consider the following fundamental problem: Given a set of points in the plane, determine a smooth curve that approximates the
Beginner s Matlab Tutorial
Christopher Lum [email protected] Introduction Beginner s Matlab Tutorial This document is designed to act as a tutorial for an individual who has had no prior experience with Matlab. For any questions
(!' ) "' # "*# "!(!' +,
MATLAB is a numeric computation software for engineering and scientific calculations. The name MATLAB stands for MATRIX LABORATORY. MATLAB is primarily a tool for matrix computations. It was developed
Operation Count; Numerical Linear Algebra
10 Operation Count; Numerical Linear Algebra 10.1 Introduction Many computations are limited simply by the sheer number of required additions, multiplications, or function evaluations. If floating-point
Chapter 19. General Matrices. An n m matrix is an array. a 11 a 12 a 1m a 21 a 22 a 2m A = a n1 a n2 a nm. The matrix A has n row vectors
Chapter 9. General Matrices An n m matrix is an array a a a m a a a m... = [a ij]. a n a n a nm The matrix A has n row vectors and m column vectors row i (A) = [a i, a i,..., a im ] R m a j a j a nj col
Introduction to the data.table package in R
Introduction to the data.table package in R Revised: September 18, 2015 (A later revision may be available on the homepage) Introduction This vignette is aimed at those who are already familiar with creating
DATA ANALYSIS II. Matrix Algorithms
DATA ANALYSIS II Matrix Algorithms Similarity Matrix Given a dataset D = {x i }, i=1,..,n consisting of n points in R d, let A denote the n n symmetric similarity matrix between the points, given as where
LAYOUT OF THE KEYBOARD
Dr. Charles Hofmann, LaSalle [email protected] Dr. Roseanne Hofmann, MCCC [email protected] ------------------------------------------------------------------------------------------------- DISPLAY CONTRAST
THE CERN/SL XDATAVIEWER: AN INTERACTIVE GRAPHICAL TOOL FOR DATA VISUALIZATION AND EDITING
THE CERN/SL XDATAVIEWER: AN INTERACTIVE GRAPHICAL TOOL FOR DATA VISUALIZATION AND EDITING Abstract G. Morpurgo, CERN As a result of many years of successive refinements, the CERN/SL Xdataviewer tool has
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
MATLAB Tutorial You need a small numb e r of basic commands to start using MATLAB. This short tutorial describes those fundamental commands. You need to create vectors and matrices, to change them, and
Linear Algebra Review. Vectors
Linear Algebra Review By Tim K. Marks UCSD Borrows heavily from: Jana Kosecka [email protected] http://cs.gmu.edu/~kosecka/cs682.html Virginia de Sa Cogsci 8F Linear Algebra review UCSD Vectors The length
:Introducing Star-P. The Open Platform for Parallel Application Development. Yoel Jacobsen E&M Computing LTD [email protected]
:Introducing Star-P The Open Platform for Parallel Application Development Yoel Jacobsen E&M Computing LTD [email protected] The case for VHLLs Functional / applicative / very high-level languages allow
VISUAL ALGEBRA FOR COLLEGE STUDENTS. Laurie J. Burton Western Oregon University
VISUAL ALGEBRA FOR COLLEGE STUDENTS Laurie J. Burton Western Oregon University VISUAL ALGEBRA FOR COLLEGE STUDENTS TABLE OF CONTENTS Welcome and Introduction 1 Chapter 1: INTEGERS AND INTEGER OPERATIONS
Vector Notation: AB represents the vector from point A to point B on a graph. The vector can be computed by B A.
1 Linear Transformations Prepared by: Robin Michelle King A transformation of an object is a change in position or dimension (or both) of the object. The resulting object after the transformation is called
CALIBRATION OF A ROBUST 2 DOF PATH MONITORING TOOL FOR INDUSTRIAL ROBOTS AND MACHINE TOOLS BASED ON PARALLEL KINEMATICS
CALIBRATION OF A ROBUST 2 DOF PATH MONITORING TOOL FOR INDUSTRIAL ROBOTS AND MACHINE TOOLS BASED ON PARALLEL KINEMATICS E. Batzies 1, M. Kreutzer 1, D. Leucht 2, V. Welker 2, O. Zirn 1 1 Mechatronics Research
Integer Factorization using the Quadratic Sieve
Integer Factorization using the Quadratic Sieve Chad Seibert* Division of Science and Mathematics University of Minnesota, Morris Morris, MN 56567 [email protected] March 16, 2011 Abstract We give
The Characteristic Polynomial
Physics 116A Winter 2011 The Characteristic Polynomial 1 Coefficients of the characteristic polynomial Consider the eigenvalue problem for an n n matrix A, A v = λ v, v 0 (1) The solution to this problem
15.062 Data Mining: Algorithms and Applications Matrix Math Review
.6 Data Mining: Algorithms and Applications Matrix Math Review The purpose of this document is to give a brief review of selected linear algebra concepts that will be useful for the course and to develop
Correcting the Lateral Response Artifact in Radiochromic Film Images from Flatbed Scanners
Correcting the Lateral Response Artifact in Radiochromic Film Images from Flatbed Scanners Background The lateral response artifact (LRA) in radiochromic film images from flatbed scanners was first pointed
Essential Mathematics for Computer Graphics fast
John Vince Essential Mathematics for Computer Graphics fast Springer Contents 1. MATHEMATICS 1 Is mathematics difficult? 3 Who should read this book? 4 Aims and objectives of this book 4 Assumptions made
Server Load Prediction
Server Load Prediction Suthee Chaidaroon ([email protected]) Joon Yeong Kim ([email protected]) Jonghan Seo ([email protected]) Abstract Estimating server load average is one of the methods that
MATLAB and Big Data: Illustrative Example
MATLAB and Big Data: Illustrative Example Rick Mansfield Cornell University August 19, 2014 Goals Use a concrete example from my research to: Demonstrate the value of vectorization Introduce key commands/functions
What s New in MATLAB and Simulink
What s New in MATLAB and Simulink Kevin Cohan Product Marketing, MATLAB Michael Carone Product Marketing, Simulink 2015 The MathWorks, Inc. 1 What was new for Simulink in R2012b? 2 What Was New for MATLAB
Parallel Computing using MATLAB Distributed Compute Server ZORRO HPC
Parallel Computing using MATLAB Distributed Compute Server ZORRO HPC Goals of the session Overview of parallel MATLAB Why parallel MATLAB? Multiprocessing in MATLAB Parallel MATLAB using the Parallel Computing
MATLAB Basics MATLAB numbers and numeric formats
MATLAB Basics MATLAB numbers and numeric formats All numerical variables are stored in MATLAB in double precision floating-point form. (In fact it is possible to force some variables to be of other types
Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65
Simulation Tools Python for MATLAB Users I Claus Führer Automn 2009 Claus Führer Simulation Tools Automn 2009 1 / 65 1 Preface 2 Python vs Other Languages 3 Examples and Demo 4 Python Basics Basic Operations
Bildverarbeitung und Mustererkennung Image Processing and Pattern Recognition
Bildverarbeitung und Mustererkennung Image Processing and Pattern Recognition 1. Image Pre-Processing - Pixel Brightness Transformation - Geometric Transformation - Image Denoising 1 1. Image Pre-Processing
OpenACC 2.0 and the PGI Accelerator Compilers
OpenACC 2.0 and the PGI Accelerator Compilers Michael Wolfe The Portland Group [email protected] This presentation discusses the additions made to the OpenACC API in Version 2.0. I will also present
Analysis of System Performance IN2072 Chapter M Matlab Tutorial
Chair for Network Architectures and Services Prof. Carle Department of Computer Science TU München Analysis of System Performance IN2072 Chapter M Matlab Tutorial Dr. Alexander Klein Prof. Dr.-Ing. Georg
CS 4204 Computer Graphics
CS 4204 Computer Graphics Computer Animation Adapted from notes by Yong Cao Virginia Tech 1 Outline Principles of Animation Keyframe Animation Additional challenges in animation 2 Classic animation Luxo
The complete beginners guide to Adobe Illustrator. Get started
The complete beginners guide to Adobe Illustrator Get started The complete beginners guide to Adobe Illustrator VISUAL DEMO - What we are going to create on this course Go to page COURSE OVERVIEW - Project
Part VI. Scientific Computing in Python
Part VI Scientific Computing in Python Compact Course @ GRS, June 03-07, 2013 80 More on Maths Module math Constants pi and e Functions that operate on int and float All return values float ceil (x) floor
PGR Computing Programming Skills
PGR Computing Programming Skills Dr. I. Hawke 2008 1 Introduction The purpose of computing is to do something faster, more efficiently and more reliably than you could as a human do it. One obvious point
Cover. SEB SIMOTION Easy Basics. Collection of standardized SIMOTION basic functions. FAQ April 2011. Service & Support. Answers for industry.
Cover SEB SIMOTION Easy Basics Collection of standardized SIMOTION basic functions FAQ April 2011 Service & Support Answers for industry. 1 Preface 1 Preface The SEB is a collection of simple, standardized
Notes on Factoring. MA 206 Kurt Bryan
The General Approach Notes on Factoring MA 26 Kurt Bryan Suppose I hand you n, a 2 digit integer and tell you that n is composite, with smallest prime factor around 5 digits. Finding a nontrivial factor
General Framework for an Iterative Solution of Ax b. Jacobi s Method
2.6 Iterative Solutions of Linear Systems 143 2.6 Iterative Solutions of Linear Systems Consistent linear systems in real life are solved in one of two ways: by direct calculation (using a matrix factorization,
Discrete Convolution and the Discrete Fourier Transform
Discrete Convolution and the Discrete Fourier Transform Discrete Convolution First of all we need to introduce what we might call the wraparound convention Because the complex numbers w j e i πj N have
2+2 Just type and press enter and the answer comes up ans = 4
Demonstration Red text = commands entered in the command window Black text = Matlab responses Blue text = comments 2+2 Just type and press enter and the answer comes up 4 sin(4)^2.5728 The elementary functions
3. Interpolation. Closing the Gaps of Discretization... Beyond Polynomials
3. Interpolation Closing the Gaps of Discretization... Beyond Polynomials Closing the Gaps of Discretization... Beyond Polynomials, December 19, 2012 1 3.3. Polynomial Splines Idea of Polynomial Splines
Streamline your large format printing and finishing workflow
Streamline your large format printing and finishing workflow i-cut Suite Eliminate errors, save time and reduce waste with the i-cut Suite. i-cut Suite is a collection of prepress software targeted specifically
MATLAB DFS. Interface Library. User Guide
MATLAB DFS Interface Library User Guide DHI Water Environment Health Agern Allé 5 DK-2970 Hørsholm Denmark Tel: +45 4516 9200 Fax: +45 4516 9292 E-mail: [email protected] Web: www.dhigroup.com 2007-03-07/MATLABDFS_INTERFACELIBRARY_USERGUIDE.DOC/JGR/HKH/2007Manuals/lsm
Vector Spaces; the Space R n
Vector Spaces; the Space R n Vector Spaces A vector space (over the real numbers) is a set V of mathematical entities, called vectors, U, V, W, etc, in which an addition operation + is defined and in which
Question 2: How do you solve a matrix equation using the matrix inverse?
Question : How do you solve a matrix equation using the matrix inverse? In the previous question, we wrote systems of equations as a matrix equation AX B. In this format, the matrix A contains the coefficients
[1] Diagonal factorization
8.03 LA.6: Diagonalization and Orthogonal Matrices [ Diagonal factorization [2 Solving systems of first order differential equations [3 Symmetric and Orthonormal Matrices [ Diagonal factorization Recall:
4. Right click grid ( ) and select New MODFLOW, then select Packages, enabling both the optional Well and Recharge option.
Groundwater Hydrology CE 40460 Example 1 -- Grid Approach Building a grid is the first step in creating a groundwater model using GMS, and it requires the following components: top and bottom elevations,
Continued Fractions and the Euclidean Algorithm
Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction
Multiplying Binomials and Factoring Trinomials Using Algebra Tiles and Generic Rectangles
Multiplying Binomials Standard: Algebra 10.0 Time: 55 mins. Multiplying Binomials and Factoring Trinomials Using Algebra Tiles and s Materials: Class set of Algebra Tiles or access to a computer for each
Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs
CSE599s: Extremal Combinatorics November 21, 2011 Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs Lecturer: Anup Rao 1 An Arithmetic Circuit Lower Bound An arithmetic circuit is just like
Programming Languages & Tools
4 Programming Languages & Tools Almost any programming language one is familiar with can be used for computational work (despite the fact that some people believe strongly that their own favorite programming
VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0
VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...
WEEK #3, Lecture 1: Sparse Systems, MATLAB Graphics
WEEK #3, Lecture 1: Sparse Systems, MATLAB Graphics Visualization of Matrices Good visuals anchor any presentation. MATLAB has a wide variety of ways to display data and calculation results that can be
Chapter 2. Point transformation. Look up Table (LUT) Fundamentals of Image processing
Chapter 2 Fundamentals of Image processing Point transformation Look up Table (LUT) 1 Introduction (1/2) 3 Types of operations in Image Processing - m: rows index - n: column index Point to point transformation
Kenken For Teachers. Tom Davis [email protected] http://www.geometer.org/mathcircles June 27, 2010. Abstract
Kenken For Teachers Tom Davis [email protected] http://www.geometer.org/mathcircles June 7, 00 Abstract Kenken is a puzzle whose solution requires a combination of logic and simple arithmetic skills.
Lecture 2 Matrix Operations
Lecture 2 Matrix Operations transpose, sum & difference, scalar multiplication matrix multiplication, matrix-vector product matrix inverse 2 1 Matrix transpose transpose of m n matrix A, denoted A T or
QUICK REFERENCE: ADOBE ILLUSTRATOR CS2 AND CS3 SECTION 1: CS3 TOOL BOX: PAGE 2 SECTION 2: CS2 TOOL BOX: PAGE 11
QUICK REFERENCE, ADOBE ILLUSTRATOR, PAGE 1 QUICK REFERENCE: ADOBE ILLUSTRATOR CS2 AND CS3 CS2 SECTION 1: CS3 TOOL BOX: PAGE 2 SECTION 2: CS2 TOOL BOX: PAGE 11 SECTION 3: GENERAL CONCEPTS: PAGE 14 SELECTING
Introduction. Chapter 1
Chapter 1 Introduction MATLAB (Matrix laboratory) is an interactive software system for numerical computations and graphics. As the name suggests, MATLAB is especially designed for matrix computations:
Fast Analytics on Big Data with H20
Fast Analytics on Big Data with H20 0xdata.com, h2o.ai Tomas Nykodym, Petr Maj Team About H2O and 0xdata H2O is a platform for distributed in memory predictive analytics and machine learning Pure Java,
Numerical Methods I Eigenvalue Problems
Numerical Methods I Eigenvalue Problems Aleksandar Donev Courant Institute, NYU 1 [email protected] 1 Course G63.2010.001 / G22.2420-001, Fall 2010 September 30th, 2010 A. Donev (Courant Institute)
CATIA V5 Tutorials. Mechanism Design & Animation. Release 18. Nader G. Zamani. University of Windsor. Jonathan M. Weaver. University of Detroit Mercy
CATIA V5 Tutorials Mechanism Design & Animation Release 18 Nader G. Zamani University of Windsor Jonathan M. Weaver University of Detroit Mercy SDC PUBLICATIONS Schroff Development Corporation www.schroff.com
Solution of Linear Systems
Chapter 3 Solution of Linear Systems In this chapter we study algorithms for possibly the most commonly occurring problem in scientific computing, the solution of linear systems of equations. We start
Nonlinear Iterative Partial Least Squares Method
Numerical Methods for Determining Principal Component Analysis Abstract Factors Béchu, S., Richard-Plouet, M., Fernandez, V., Walton, J., and Fairley, N. (2016) Developments in numerical treatments for
KaleidaGraph Quick Start Guide
KaleidaGraph Quick Start Guide This document is a hands-on guide that walks you through the use of KaleidaGraph. You will probably want to print this guide and then start your exploration of the product.
Introduction to MATLAB IAP 2008
MIT OpenCourseWare http://ocw.mit.edu Introduction to MATLAB IAP 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Introduction to Matlab Ideas for
Approximation Algorithms
Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms
Lecture 5: Singular Value Decomposition SVD (1)
EEM3L1: Numerical and Analytical Techniques Lecture 5: Singular Value Decomposition SVD (1) EE3L1, slide 1, Version 4: 25-Sep-02 Motivation for SVD (1) SVD = Singular Value Decomposition Consider the system
1 2 3 1 1 2 x = + x 2 + x 4 1 0 1
(d) If the vector b is the sum of the four columns of A, write down the complete solution to Ax = b. 1 2 3 1 1 2 x = + x 2 + x 4 1 0 0 1 0 1 2. (11 points) This problem finds the curve y = C + D 2 t which
Computational Mathematics with Python
Boolean Arrays Classes Computational Mathematics with Python Basics Olivier Verdier and Claus Führer 2009-03-24 Olivier Verdier and Claus Führer Computational Mathematics with Python 2009-03-24 1 / 40
Financial Reporting Using Microsoft Excel. Presented By: Jim Lee
Financial Reporting Using Microsoft Excel Presented By: Jim Lee Table of Contents Financial Reporting Overview... 4 Reporting Periods... 4 Microsoft Excel... 4 SedonaOffice General Ledger Structure...
CS3220 Lecture Notes: QR factorization and orthogonal transformations
CS3220 Lecture Notes: QR factorization and orthogonal transformations Steve Marschner Cornell University 11 March 2009 In this lecture I ll talk about orthogonal matrices and their properties, discuss
2: Computer Performance
2: Computer Performance http://people.sc.fsu.edu/ jburkardt/presentations/ fdi 2008 lecture2.pdf... John Information Technology Department Virginia Tech... FDI Summer Track V: Parallel Programming 10-12
Data Structures. Algorithm Performance and Big O Analysis
Data Structures Algorithm Performance and Big O Analysis What s an Algorithm? a clearly specified set of instructions to be followed to solve a problem. In essence: A computer program. In detail: Defined
How long is the vector? >> length(x) >> d=size(x) % What are the entries in the matrix d?
MATLAB : A TUTORIAL 1. Creating vectors..................................... 2 2. Evaluating functions y = f(x), manipulating vectors. 4 3. Plotting............................................ 5 4. Miscellaneous
WEBFOCUS QUICK DATA FOR EXCEL
WEBFOCUS QUICK DATA FOR EXCEL BRIAN CARTER INFORMATION BUILDERS SUMMIT 2008 USERS CONFERENCE JUNE 2008 Presentation Abstract: Even with the growing popularity and evolvement of Business Intelligence products
ECE 842 Report Implementation of Elliptic Curve Cryptography
ECE 842 Report Implementation of Elliptic Curve Cryptography Wei-Yang Lin December 15, 2004 Abstract The aim of this report is to illustrate the issues in implementing a practical elliptic curve cryptographic
Data Mining. Cluster Analysis: Advanced Concepts and Algorithms
Data Mining Cluster Analysis: Advanced Concepts and Algorithms Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004 1 More Clustering Methods Prototype-based clustering Density-based clustering Graph-based
RAID Basics Training Guide
RAID Basics Training Guide Discover a Higher Level of Performance RAID matters. Rely on Intel RAID. Table of Contents 1. What is RAID? 2. RAID Levels RAID 0 RAID 1 RAID 5 RAID 6 RAID 10 RAID 0+1 RAID 1E
Orthogonal Projections
Orthogonal Projections and Reflections (with exercises) by D. Klain Version.. Corrections and comments are welcome! Orthogonal Projections Let X,..., X k be a family of linearly independent (column) vectors
