1

 Use of MathCAD to handle statistical data
 Data storage in vectors and matrices
 MathCAD’s builtin functions:
 Mean, standard deviation etc
 Probability distributions
 Extending MathCAD through defining functions and programming
 Revision of PH1570

2

 Way of storing related data
 Experimental Results (datasets)
 Coefficients
 One variable name, many data points
 Indexing
 var_{0}, var_{1}, var_{2}, var_{3} …

3

 Vector – 1dimensional
 Matrix – 2dimensional
 Array – general term, covers both

4

 Matrix toolbar has tools to:
 Create and
 Operate on matrices
 Many functions f(x) operate on matrices

5

 Same for defining ordinary variable
 Follow : with
 [:::] from toolbar or
 <ctrlm> or
 InsertMatrix
 Dialog box for rows & columns

6

 3 –element vector – empty
 Placeholders to fill in
 Can use units

7

 Define array and input data in one operation
 Resizes to fit data
 From InsertDataTable

8

 Index addressing allows access to individual elements of array
 Examine & Set elements
 Indices start at 0
 Indices use [ key
 2D matrices use two indices for row, column selection

9

 Simple 2 element vector
 Examine elements
 Set element 0
 Result of setting

10

 Sample matrix
 Examine elements
 Subscript too big
 Set element
 Result

11

 From f(x) dialog box under “Statistics”
 Averaging
 mean() ‘Average value’
 median() ‘Half way item’
 mode() ‘Most common value’

12

 Variance & Standard Deviation
 2 forms of each
 Analysis of sample
 Analysis of whole population
 Note capitalisation

13

 Summation operator on matrix palette
 Sum of all elements in a vector

14

 Operators on Calculus palette
 Do summation on any expression
 2 forms
 Plain => defines local RV
 Range Variable => uses existing RV

15

 Sum of first 5 integers
 Sum of elements 2030 of vector Counts

16

 Can do much without programming
 Some algorithms need programs
 Iterative, repeat until solution
 Can make other tasks simpler
 Hide detail inside a program

17

 Applies to all programming
 K.I.S.S. principle

18

 All MathCAD programs are functions
 Expression over multiple lines
 Lines executed in order
 Local Variables
 Value of last line is result

19

 Common subexpression calculated 3 times in function
 è Can rewrite
using a program

20

 1^{st} line calculates sqrt & assigns to local variable ‘r’
 2^{nd} line calculates expression & returns answer

21

 Programming Palette from toolbar
 Select keywords from palette, DO NOT TYPE
 Add Line to add lines to program
 Watch selection box, carefully

22

 Assignments are local to program
 Assignments in program use ¬
 Can use full range of MathCAD functions in
program
 Last line is result of program
 Use Vectors & Arrays to return multiple results

23

 Tutorials
 Getting started èDefining functions
 Features InDepth è Programming
 Quicksheets

24

