Ch 9-10 Subsetting Ordering Array operations Iteration

Slides:



Advertisements
Similar presentations
Basics of R, Ch  Functions  Help  Managing your Objects  Getting Data into R  Getting Results out of R 1 © Fall 2004 Don Edwards and the University.
Advertisements

1 R Programming Zhi Wei. 2 Language layout  Three types of statement expression: it is evaluated, printed, and the value is lost (3+5) assignment: passes.
Maths for Computer Graphics
1 Ch 7-8 lArithmetic lLogical Operators © Fall 2004 Don Edwards and the University of South Carolina.
Lecture 7 Sept 19, 11 Goals: two-dimensional arrays (continued) matrix operations circuit analysis using Matlab image processing – simple examples Chapter.
Lecture 6 Sept 15, 09 Goals: two-dimensional arrays matrix operations circuit analysis using Matlab image processing – simple examples.
Concatenation MATLAB lets you construct a new vector by concatenating other vectors: – A = [B C D... X Y Z] where the individual items in the brackets.
1 Ch 9-10 lSubsetting lOrdering lArray operations lIteration © Fall 2004 Don Edwards and the University of South Carolina.
Arrays. What is an Array? Similar to a Matrix. Collection of data that needs similar processing. Example: Transpose of a matrix.
Objective Video Example by Mrs. G Give It a Try Lesson 4.1  Add and subtract matrices  Multiply a matrix by a scalar number  Solve a matrix equation.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Databases. Not All Tables Are Created Equal Spreadsheets use tables to store data and formulas associated with that data The “meaning” of data is implicit.
1.7 Linear Independence. in R n is said to be linearly independent if has only the trivial solution. in R n is said to be linearly dependent if there.
R Workshop #2 Basic Data Analysis. What we did last week: Understand the basics of how R works Generated objects (vectors, matrices, etc.) Read in data.
Math 252: Math Modeling Eli Goldwyn Introduction to MATLAB.
Table of Contents Matrices - Definition and Notation A matrix is a rectangular array of numbers. Consider the following matrix: Matrix B has 3 rows and.
Notes Over 4.2 Finding the Product of Two Matrices Find the product. If it is not defined, state the reason. To multiply matrices, the number of columns.
Do Now: Perform the indicated operation. 1.). Algebra II Elements 11.1: Matrix Operations HW: HW: p.590 (16-36 even, 37, 44, 46)
2 2.4 © 2016 Pearson Education, Ltd. Matrix Algebra PARTITIONED MATRICES.
Chapter 17 Arrays Perl to denote an array, for = (10, 20, 30, 50); Array subscripts are number from 0. Array elements require scalar.
REVIEW Linear Combinations Given vectors and given scalars
1.4 The Matrix Equation Ax = b
Umm Al-Qura University
Chapter 6: Using Arrays.
13.4 Product of Two Matrices
Matrix Operations Free powerpoints at
Linear Algebra review (optional)
1.5 Matricies.
Matrices - Addition and Subtraction
Matrix Operations Free powerpoints at
MULTI-DIMENSIONAL ARRAY
Matrix Operations.
Matrices and Data Holt Algebra 2.
Ch 7-8 Arithmetic Logical Operators
Matrix Operations Free powerpoints at
Example of programming a quantum robot
Physical Join Operators
Array Processor.
Multiplying Matrices.
7.3 Matrices.
Use of Mathematics using Technology (Maltlab)
Introduction to Matrices
Matrices Elements, Adding and Subtracting
Digital Image Processing
CSCI N207 Data Analysis Using Spreadsheet
2.2 Introduction to Matrices
Logical Operations In Matlab.
Statistics 540 Computing in Statistics
Basics of R, Ch Functions Help Managing your Objects
Matlab Intro.
Given value and sorted array, find index.
Multidimensional array
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Multiplying Matrices.
Matrices and Data Holt Algebra 2.
Simulation And Modeling
TransCAD Working with Matrices 2019/4/29.
3.6 Multiply Matrices.
2-Dimensional Lists (Matrices) in Python
Linear Algebra review (optional)
Division Using Arrays.
Matrix A matrix is a rectangular arrangement of numbers in rows and columns Each number in a matrix is called an Element. The dimensions of a matrix are.
Arrays in MatLab Arrays can have any number dimensions
Multiplying Matrices.
Multiplying Matrices.
Matrix Multiplication Sec. 4.2
Introduction to Matrices
An Introduction to Programming though C++
Matlab Intro.
Multiplying Matrices.
Presentation transcript:

Ch 9-10 Subsetting Ordering Array operations Iteration © Fall 2004 Don Edwards and the University of South Carolina

9 Subsetting Extraction with “[]” for vectors and matrices : and c() Rows, columns, and sub-matrices Indices are not extracted Extraction with logical vectors Statements look self-referential We can recover index information with match() or which() for unique entries.

9 Sorting Order function Sort function lacks functionality Creates vector of indices that can then be used to “extract” ordered data files Like a logical vector, the focus is on the index object, not the output object Sort function lacks functionality Ordering of factor levels may not be alphabetical

10 Matrix Operations Splus was very inefficient at looping R is improved Both Splus and R have built-in iterative capabilities Functions that operate on vectors and arrays The apply() function tapply() works on groups (defined by factors) tapply() is quite a versatile feature

10 Iteration If we need to iterate, we use for() and while() statements for() uses a counter while() uses a logical comparison If for() is slow, R can call both C++ and Fortran subroutines