Post Reply 
With ZIP()...
05-27-2015, 10:07 PM
Post: #2
RE: With ZIP()...
(05-27-2015 02:43 PM)DrD Wrote:  after reading the zip() help description, given something like:

L1:={1,2}; // (goal: Multiply two lists of unequal size)

the zip function would return a list:

zip('*',L1,L2,0); --> syntax error (help shows single quotes surrounding function)
zip("*",L1,L2,0); --> Error: Invalid input
zip("L1*L2",L1,L2,0); --> {2,8,"1","L"} what the heck is that?
zip is a CAS command.

zip('*',L1,L2,0) works in CAS mode and returns [2 8 0 0] which is the right result according to the help: [L1(1)*L2(1) L1(2)*L2(2) L1(3)*L2(3) L1(4)*L2(4)] after padding L1 with 0's.

In Home or in a program you should write it: zip("'*',L1,L2,0").

(05-27-2015 02:43 PM)DrD Wrote:  I was expecting {{2,4,6,8},{4,8,12,16}}, or a single list concatenation of this, or some zero padded similar output.
Now, if you want to get as the result {{2,4,6,8},{4,8,12,16}} you should try EXECON("&1*L2",L1), it works both in Home and CAS.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
With ZIP()... - DrD - 05-27-2015, 02:43 PM
RE: With ZIP()... - Didier Lachieze - 05-27-2015 10:07 PM
RE: With ZIP()... - compsystems - 05-29-2015, 12:01 PM
RE: With ZIP()... - DrD - 05-29-2015, 12:39 PM

User(s) browsing this thread: 1 Guest(s)