12.07.2015 Views

Learning Guide Learning Guide

Learning Guide Learning Guide

Learning Guide Learning Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

30 • Chapter 2: Mathematics with Maple: the Basicsearth_data := table([mass = [0.5976000000 10 25 , kg],radius = [0.6378164000 10 7 , m],circumference = [0.4007520000 10 8 , m]])> earth_data[mass];[0.5976000000 10 25 , kg]In this example, each index is a name and each entry is a list. In fact,this is a rather simple case. Often, much more general indices are useful.For example, you could construct a table which has algebraic formulæ forindices and the derivatives of these formulæ as values.StringsA string is also an object in Maple and is created by enclosing any numberof characters in double quotes.> "This is a string.";“This is a string.”They are nearly indivisible constructs that stand only for themselves;they cannot be assigned a value.> "my age" := 32;Error, invalid left hand side of assignmentLike elements of lists or arrays, the individual characters of a stringcan be indexed with square bracket notation.> mystr := "I ate the whole thing.";mystr := “I ate the whole thing.”> mystr[3..5];“ate”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!