12.07.2015 Views

Learning Guide Learning Guide

Learning Guide Learning Guide

Learning Guide Learning Guide

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

174 • Chapter 5: Evaluation and Simplification> P := zip( pair, X, Y );P := [[2, 6], [3, 15], [5, 20], [7, 15], [11, 6], [13, 1]]> plot( P );20181614121086422 4 6 8 10 12If the two lists have different length, then zip returns a list as longas the shorter one.> zip( (x,y) -> x.y, [a,b,c,d,e,f], [1,2,3] );[a, 2 b, 3 c]You can specify a fourth argument to zip. Then zip returns a list aslong as the longer input list, using the fourth argument for the missingvalues.> zip( (x,y) -> x.y, [a,b,c,d,e,f], [1,2,3], 99 );[a, 2 b, 3 c, 99 d, 99 e, 99 f]> zip( igcd, [7657,342,876], [34,756,213,346,123], 6! );[1, 18, 3, 2, 3]The zip command can also merge vectors. For more information, referto ?zip.Sorting ListsA list is a fundamental order-preserving data structure in Maple. Theelements in a list remain in the order used in creating the list. You cancreate a copy of a list sorted in another order by using the sort command.

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

Saved successfully!

Ooh no, something went wrong!