Linear Algebra Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See

Slides:



Advertisements
Similar presentations
4.1 Introduction to Matrices
Advertisements

1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 10.
Solving Algebraic Equations
Example 1 Matrix Solution of Linear Systems Chapter 7.2 Use matrix row operations to solve the system of equations  2009 PBLPathways.
Visualization Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
CIS 101: Computer Programming and Problem Solving Lecture 7 Usman Roshan Department of Computer Science NJIT.
Matrix Mathematics in MATLAB and Excel
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Using Inverse Matrices Solving Systems. You can use the inverse of the coefficient matrix to find the solution. 3x + 2y = 7 4x - 5y = 11 Solve the system.
Introduction Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Chapter 10 Review: Matrix Algebra
Academy Algebra II/Trig
Finite Mathematics Dr. Saeid Moloudzadeh Using Matrices to Solve Systems of Equations 1 Contents Algebra Review Functions and Linear Models.
Section 1.1 Introduction to Systems of Linear Equations.
1.1.2 INTRODUCTION TO SYSTEMS OF LINEAR EQUATIONS Chapter 1: Systems of Linear Equations and Matrices SWBAT: Redefine algebraic operations as Elementary.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
College algebra 6.1 Systems of Linear Equations in Two Variables
Review of Matrices Or A Fast Introduction.
4.4 & 4.5 Notes Remember: Identity Matrices: If the product of two matrices equal the identity matrix then they are inverses.
Chapter 6 Matrices and Determinants Copyright © 2014, 2010, 2007 Pearson Education, Inc Matrix Solutions to Linear Systems.
Matrix Solutions to Linear Systems. 1. Write the augmented matrix for each system of linear equations.
Section 3.6 – Solving Systems Using Matrices
Inverse Matrices and Systems
Basic File Input and Output Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Algebra 3: Section 5.5 Objectives of this Section Find the Sum and Difference of Two Matrices Find Scalar Multiples of a Matrix Find the Product of Two.
Chapter 9 Matrices and Determinants Copyright © 2014, 2010, 2007 Pearson Education, Inc Determinants and Cramer’s Rule.
Class Opener:. Identifying Matrices Student Check:
Examples of linear transformation matrices Some special cases of linear transformations of two-dimensional space R 2 are illuminating:dimensional Dimoffree.svgDimoffree.svg‎
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Linear Algebra Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Introduction Copyright © Software Carpentry This work is licensed under the Creative Commons Attribution License See
Basic Flow Control Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
ES 240: Scientific and Engineering Computation. Chapter 8 Chapter 8: Linear Algebraic Equations and Matrices Uchechukwu Ofoegbu Temple University.
Slide Copyright © 2009 Pearson Education, Inc. 7.3 Matrices.
Sullivan Algebra and Trigonometry: Section 12.3 Objectives of this Section Write the Augmented Matrix of a System of Linear Equations Write the System.
Algebra II Honors Problem of the Day Homework page eoo The following system has been solved and there are infinite solutions in the form of (
Chapter 1: Systems of Linear Equations and Matrices
10.3 Systems of Linear Equations: Matrices. A matrix is defined as a rectangular array of numbers, Column 1Column 2 Column jColumn n Row 1 Row 2 Row 3.
8.2 Operations With Matrices
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
1 Beginning & Intermediate Algebra – Math 103 Math, Statistics & Physics.
Basics Copyright © Software Carpentry 2011 This work is licensed under the Creative Commons Attribution License See
Sec 4.1 Matrices.
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Intro to Matlab Yipei Wang & Qihui Li {yipeiw,
Copyright © 1999 by the McGraw-Hill Companies, Inc. Barnett/Ziegler/Byleen College Algebra, 6 th Edition Chapter Seven Matrices & Determinants.
6.S093: Visual Recognition through Machine Learning Competition MATLAB tutorial.
“Moh’d Sami” AshhabSummer 2008University of Jordan MATLAB By (Mohammed Sami) Ashhab University of Jordan Summer 2008.
Notes Over 3.1 Solving a System Graphically Graph the linear system and estimate the solution. Then check the solution algebraically.
EXAMPLE 1 Solve a system graphically Graph the linear system and estimate the solution. Then check the solution algebraically. 4x + y = 8 2x – 3y = 18.
Algebra Review. Systems of Equations Review: Substitution Linear Combination 2 Methods to Solve:
Do Now: Perform the indicated operation. 1.). Algebra II Elements 11.1: Matrix Operations HW: HW: p.590 (16-36 even, 37, 44, 46)
Chapter 5: Matrices and Determinants Section 5.5: Augmented Matrix Solutions.
4.1 An Introduction to Matrices Katie Montella Mod. 6 5/25/07.
Systems of Linear Equations: Matrices
Barnett/Ziegler/Byleen College Algebra, 7th Edition
(Mohammed Sami) Ashhab
Systems of Linear Equations
Solving Systems of Equations
MA10210: Algebra 1B
7.3 Matrices.
Lecture 11 Matrices and Linear Algebra with MATLAB
Matrix Solutions to Linear Systems
Communication and Coding Theory Lab(CS491)
Applications of Matrices
Solving Linear Equations by Graphing
3.6 Multiply Matrices.
Matrices.
Presentation transcript:

Linear Algebra Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See for more information. Matlab Programming

Matrix ProgrammingLinear Algebra Matlab arrays are designed to act just like matrices and tensors from linear algebra. >> a = [2 3; 4 5]; >> b = [1 2;1 2];

Matrix ProgrammingLinear Algebra Matlab arrays are designed to act just like matrices and tensors from linear algebra. >> a = [2 3; 4 5]; >> b = [1 2;1 2]; >> a * b

Matrix ProgrammingLinear Algebra Lots of useful utilities >>> sum(a) 68 >>> sum(a, 2) 5 9 Why is one a row and one a column?

Matrix ProgrammingLinear Algebra Example: disease statistics –One row per patient –Columns are hourly responsive T cell counts >>> data(:, 1) # t 1 count for all patients >>> data(1, :) # all samples for patient

Matrix ProgrammingLinear Algebra >>> mean(data) # over time >>> mean(data, 2) # per patient mean(data,1) is the same as mean(data).

Matrix ProgrammingLinear Algebra Select the data for people who started with a responsive T cell count of 0 >>> data(:, 1) >>> data(:, 1) == >>> data( data(:, 1) == 0 )

Matrix ProgrammingLinear Algebra Find the mean T cell count over time for people who started with a count of 0 >>> data(:, 1) Column 1

Matrix ProgrammingLinear Algebra Find the mean T cell count over time for people who started with a count of 0 >>> data(:, 1) == 0 Column 1 is 0

Matrix ProgrammingLinear Algebra Find the mean T cell count over time for people who started with a count of 0 >>> data( data(:, 1) == 0 ) Rows where column 1 is 0

Matrix ProgrammingLinear Algebra Find the mean T cell count over time for people who started with a count of 0 >>> mean(data( data(:, 1) == 0 )) Mean along axis 1 of rows where column 1 is 0

Matrix ProgrammingLinear Algebra Find the mean T cell count over time for people who started with a count of 0 >>> mean(data( data(:, 1) == 0 ))

Matrix ProgrammingLinear Algebra Find the mean T cell count over time for people who started with a count of 0 >>> mean(data( data(:, 1) == 0 )) Key to good array programming: no loops!

Matrix ProgrammingLinear Algebra There are thousands of built-in functions in Matlab. The are fast… … and someone else has debugged them. conj conv corr diag fft gradient hist lsqr eig roots solve ode15s

Matrix ProgrammingLinear Algebra Matlab documentation: examples and a brief summary of the algorithm they implement. >> help solve SOLVE Symbolic solution of algebraic equations. SOLVE('eqn1','eqn2',...,'eqnN') SOLVE('eqn1','eqn2',...,'eqnN','var1,var 2,...,varN‘) …

Matrix ProgrammingLinear Algebra Type ‘help’ at the command line to bring up a list of all available functions. If Matlab doesn’t have the exact function you are looking for, you can: 1) Check Matlab Central’s file exchange, where you’ll find many cutting edge packages, or 2) Build the function yourself using the information in the next lecture.

February, 2011 created by Richard T. Guy Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See for more information.