lab2_cmf01

# lab2_cmf01 - CGN 3421 ORIGIN 1 RANGE VARIABLES . Computer...

This preview shows pages 1–2. Sign up to view the full content.

CGN 3421 lab2_cmf01.fm page 1 of 4 CGN 3421 Computer Methods Fall 2001 Lab #2 9/5/01 range variables, increments, vectors, units, plotting ORIGIN 1 RANGE VARIABLES . .. Range variables are single variables that take on multiple values. They are used to perform many of the operations which would require loops in a traditional programming language. Range variables are declared in Mathcad as var := start, next; end Note that instead of specifying an increment directly, the increment is specified indirectly by specifying the next value in the sequence. If the value of next is omitted, the default increment is 1 or -1 depending on the values of start and end. i1 2 , 5 .. := j4 2 , 4 .. := x 0 0.1 , 0.4 .. := y1 5 .. := z5 1 .. := i 1 2 3 4 5 = j -4 -2 0 2 4 = x 0 0.1 0.2 0.3 0.4 = y 1 2 3 4 5 = z 5 4 3 2 1 = Range variables are NOT the same as matrices or vectors. Note how the presentation i = looks different from a vector vec 3 9 := . Range variables are useful for plotting functions and creating vectors, as we shall see. Working with Increments. .. Lets create a range variable x from pi to 2*pi to represent the x-axis of a sign wave we wish to plot. First we decide that we want the x-axis to consist of 5 points,

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/10/2011 for the course CGN 3421 taught by Professor Long during the Spring '08 term at University of Florida.

### Page1 / 4

lab2_cmf01 - CGN 3421 ORIGIN 1 RANGE VARIABLES . Computer...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online