Programming Tutorial > Task 1–3: Using Operators
  
Task 1–3: Using Operators
Using Operators and Units
Use PTC Mathcad built-in operators to calculate the area of a sector of circle as shown below.
1. Create a new program and define a local variable r to be 1 meter.
* 
PTC Mathcad identifies the letter m as a unit.
2. Define the angle α as 23 degrees.
3. Insert the definite integral operator.
4. Add the required values in the integral placeholders and multiply the integral by 1/2 as shown below.
5. Evaluate the program to get the area of the sector.
Using PTC Mathcad Built-In Functions and Matrices
1. Create a new program and define two vectors as shown below.
2. On the Functions tab, in the Statistics list, insert the mean function. The function is added with empty placeholders.
3. Calculate the mean of m1 and m2 elements and delete the remaining placeholders.
Practice
Before you move on to the next exercise, define a function f that receives a vector v as input.
Function f is a program that uses PTC Mathcad built-in functions. It returns a three-element vector containing the vector’s length, the maximal element in vector v, and the median of vector v.
Proceed to Exercise 2.