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.

2.5 Basic Types of Maple Objects • 21> f;3> h;1ListsYou create a list by enclosing any number of Maple objects (separatedby commas) in square brackets.> data_list := [1, 2, 3, 4, 5];data_list := [1, 2, 3, 4, 5]> polynomials := [x^2+3, x^2+3*x-1, 2*x];polynomials := [x 2 + 3, x 2 + 3 x − 1, 2 x]> participants := [Kathy, Frank, Rene, Niklaus, Liz];participants := [Kathy, Frank, Rene, Niklaus, Liz]Thus, a list is an expression sequence enclosed in square brackets.Maple preserves the order and repetition of elements in a list. Thus,[a,b,c], [b,c,a], and [a,a,b,c,a] are all different.> [a,b,c], [b,c,a], [a,a,b,c,a];[a, b, c], [b, c, a], [a, a, b, c, a]The fact that order is preserved allows you to extract a particularelement from a list without searching for it.> letters := [a,b,c];letters := [a, b, c]> letters[2];

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

Saved successfully!

Ooh no, something went wrong!