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
match - pattern matching
Calling Sequence
match(expr = pattern, v, 's')
match(expr = pattern, {v1, v2, ..., vN}, 's')
Parameters
expr
-
expression of type algebraic to be matched
pattern
pattern (also of type algebraic) to match
v
name of the main variable
's'
name of the return argument
{v1, v2, ..., vN}
names of the main variables
Description
The match(expr = pattern, v, 's') calling sequence returns true if it can match expr to pattern for some values of the variables (excluding the main variable, v). Otherwise, it returns false.
The match(expr = pattern, {v1, v2, ..., vN}, 's') calling sequence returns true if it can match expr to pattern for some values of the variables (excluding the main variables, {v1, v2, ..., vN}). Otherwise, it returns false.
Note: In the multiple main variable case, the pattern specified must be a polynomial in all, or all but one of, the main variables. That is, type(pattern, polynom(anything, vI)) must be true for (N - 1) values of I in the range 1, 2, ..., N. Otherwise, the match command returns false.
If the match is successful, s is assigned a substitution set such that .
The main variables must be matched exactly in the pattern. In other words, the main variables cannot be substituted for any value.
The match command attempts to compute expressions to satisfy the pattern, as opposed to the typematch command that matches the form of the objects.
Examples
In the multiple main variable case, if the pattern is not a polynomial in (all but one of) the main variables, the match command always returns false.
The pattern is polynomial in one of the two main variables, and suitable values can be found for all non-main variables in the following example.
See Also
patmatch, solve[identity], subs, type/polynom, typematch
Download Help Document