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.6 Expression Manipulation • 31> mystr[11..-2];“whole thing”A negative index represents a character position counted from theright end of the string. In the example above, −2 represents the secondlast character.The concatenation operator, “||”, or the cat command is used tojoin two strings together, and the length command is used to determinethe number of characters in a string.> newstr := cat("I can’t believe ", mystr);newstr := “I can’t believe I ate the whole thing.”> length(newstr);38There are other commands that operate on strings and many morethat take strings as input. For examples, refer to ?StringTools.2.6 Expression ManipulationMany of Maple’s commands concentrate on manipulating expressions.This includes manipulating results of Maple commands into a familiarform, or a form with which you want to work. This can also involvemanipulating your own expressions into a form with which Maple canwork. This section introduces the most commonly used commands in thisarea.The simplify CommandYou can use this command to apply simplification rules to an expression.Maple has simplification rules for various types of expressions andforms, including trigonometric functions, radicals, logarithmic functions,exponential functions, powers, and various special functions.> expr := cos(x)^5 + sin(x)^4 + 2*cos(x)^2> - 2*sin(x)^2 - cos(2*x);

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

Saved successfully!

Ooh no, something went wrong!