11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming 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.

4.6 Output Commands • 177One-Dimensional Expression OutputThe lprint command prints Maple expressions in a one-dimensional notationsimilar to the format Maple uses for input. In most cases, youcan use this output as input, and the same expression would result. Thesingle exception is if the expression contains Maple names containing nonalphanumericcharacters.The lprint command is called as follows.lprint( expressionSequence )The expressionSequence consists of one or more Maple expressions. Eachof the expressions is printed in turn, with three spaces separating each ofthem. Maple prints a new line character after the last expression.Maple always sends the output that lprint produces to the defaultoutput stream. You can use the writeto and appendto commands, describedlater, to temporarily redirect the default output stream to afile.The interface parameter screenwidth affects the output of lprint.If possible, Maple wraps the output between tokens. If a single token istoo long to display (for example, a very long name or number), Maplebreaks it across lines, and prints a backslash, “\”, before each line break.Example The following command-line example illustrates lprint output,and how screenwidth affects it.> lprint(expand((x+y)^5));x^5+5*x^4*y+10*x^3*y^2+10*x^2*y^3+5*x*y^4+y^5> interface(screenwidth=30);> lprint(expand((x+y)^5));x^5+5*x^4*y+10*x^3*y^2+10*x^2*y^3+5*x*y^4+y^5Two-Dimensional Expression OutputThe print command prints Maple expressions in a two-dimensional notation.Depending on the version of Maple and the user interface, thisnotation is either the standard math notation that appears in text books

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

Saved successfully!

Ooh no, something went wrong!