Professional Documents
Culture Documents
Assume the following set of ordered pairs that need to be plotted, similar to an x/y scatter graph in
Excel:
2 1
DataMatrix :=
3 .5
4.75 2.3
5.25
1.5
Pull data from each column of the array using the Matrix Column tool M<> (ctrl-6)
Remember, the default for array starting locations in Mathcad is 0
0
X := DataMatrix
1
Y := DataMatrix
2 1
X=
3
Y=
0.5
Check the values
4.75 2.3
5.25 1.5
2.5
2
Quick Plot
Y 1.5
0.5
2 3 4 5 6
X
Graphing_Summing_Arrays
Clean this graph up a bit by automatically setting the Axis limits
minx := min( X) = 2
minx := floor( minx) = 2
2
Y
1
0
2 3 4 5 6
X
2 2.5
3 1.5
A := 3.5 .75
4 1.5
5.25 2.5
2.5
Note that you can plot directly from the
2 2-D array
Y
1 1.5
A
1
0.5
2 3 4 5 6
0
X, A
Graphing_Summing_Arrays
Summing Array Elements:
ORIGIN := 1
7
6
5
C := 4
Double check values in select locations
3
2
1 C =6 C =5 C =4 C =3
2 3 4 5
5
sum :=
C
j
Sum up elements in location 2 through 5 inclusive
This tool is found in the Calculus toolbar
j=2
sum = 18
check := C + C + C + C
2 3 4 5
check = 18
Note: Can not do this directly with functions as summing elements of functions defined
with range variables does not really sum the elements themselves (if the range value does
not increment by 1).
Example:
2
f ( q ) := q + 9 Define a function
at the third location as this is
5 f ( q ) = 17
not an array.
2.75 q= 0
0
The above actually a sum of f(0) and f(1) f (0) = 9
f (1) = 8
Graphing_Summing_Arrays