Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
Algebraic.toString - convert an Algebraic expression to a string
Calling Sequence
String toString() throws MapleException
Description
The toString function returns a Java String representation of the Algebraic expression.
The format of the returned String is compatible with Maple syntax. The string may be used as, or to form, an evaluatable statement.
Some care should be taken when using toString to form a statement. The returned String does not protect the atomic nature of the Algebraic with parenthesis; therefore, the order of operations may cause unexpected results.
For example, evaluating the string "2*"+.toString()+";" does not return twice the value of . In particular if algeb.toString() returns "x+y", then the string is "2*x+y;", which evaluates to , not .
Examples
import com.maplesoft.openmaple.*;
import com.maplesoft.externalcall.MapleException;
class Example
{
public static void main( String notused[] ) throws MapleException
String mapleArgs[];
Engine engine;
Algebraic a1;
mapleArgs = new String[1];
mapleArgs[0] = "java";
engine = new Engine( mapleArgs, new EngineCallBacksDefault(),
null, null );
a1 = engine.evaluate( "int( x^x, x ):" );
System.out.println( "("+a1.toString()+")" );
a1 = engine.evaluate( "\Maple likes strings\:" );
System.out.println( "("+a1+")" );
a1 = engine.evaluate( "Randpoly(10,x) mod 7:" );
}
Executing this code should produce the following output.
(int(x^x,x))
("Maple likes strings")
(6*x^10+2*x^9+2*x^8+3*x^7+5*x^6+5*x^5+5*x^4+4*x^3+5*x^2+2*x+6)
See Also
ExternalCalling/Java/MapleException, OpenMaple, OpenMaple/Java/Algebraic, OpenMaple/Java/API, OpenMaple/Java/Engine/evaluate
Download Help Document