Download MuPAD User's Guide

Transcript
5
Programming Fundamentals
To combine lists with unequal numbers of entries, use the zip command. By default, the
resulting list has the same number of entries as the shortest list:
list1 := [a, b]:
list2 := [d, e, f]:
zip(list1, list2, _plus);
zip(list1, list2, _mult);
zip(list1, list2, _power)
To produce the list with the number of entries equal to the longer list, use a default value
as additional parameter:
zip(list1, list2, _plus, 100)
Add, Replace, or Remove List Entries
To add new entries to the end of a list, use the append command or the . (dot) operator:
list := [a, b, c]:
list := append(list, d, e, f);
list := list.[1, 2, 3, 4]
5-16