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
Matrix Definitions for the Matlab Package
Calling Sequence
function(M, ...)
Matlab[function](M, ...)
Description
A MatlabMatrix is a matrix defined in MATLAB memory space. In Maple, the matrix is always named as a string, with double quotes. For example, Matlab[inv]("M") computes the inverse of the variable, "M", which is defined in MATLAB. If a variable M is defined in Maple, it will be unaffected by, and have no effect on the stated call. The two calls, Matlab[inv](M) and Matlab[inv]("M") are very different.
A MapleMatrix is any Maple expression that is equivalent to a matrix. For example Array(1..2,[1,2]) is equivalent to [1,2], or Vector([1,2]). A MapleMatrix can be an rtable (Array, Matrix or Vector), a table, or a constant (numeric or complex numeric or a symbolic constant such as Pi or infinity). All elements of the MapleMatrix must be of type constant.
MATLAB has access to variables defined in its memory space, and Maple has access to variables defined in its memory space. Variables are not automatically shared between memory spaces; they must be explicitly set or read.
For example, if a user starts Maple and defines a matrix "M" by typing M := Matrix([[1,2],[3,4]]); the memory space looks like this.
Maple Memory
+--------------+
| M |
If that user then opens a link to MATLAB and sets a variable, "X", in MATLAB to the same value as "M" (using the command Matlab[setvar]("X", M);), the memory is as follows.
Maple Memory MATLAB Memory
+--------------+ +---------------+
| M | | X |
The variable M is a MapleMatrix, and "X" is a MatlabMatrix. The command Matlab[inv](M) copies the matrix M to MATLAB memory space, defining a temporary variable result_for_maple in the process. MATLAB computes the inverse of result_for_maple and sends the result back to Maple.
The command Matlab[inv]("X") computes the inverse of "X" and sends the result to Maple.
It is possible to define the name "M" in both Maple and MATLAB. After the command Matlab[setvar]("M", Pi), the memory spaces would be as follows.
| M | | X, M |
Consider the two commands Matlab[det](M), and Matlab[det]("M"). The subtle difference between these commands makes a significant difference in their results. The first command returns the determinant of the 2x2 matrix, M=[[1,2],[3,4]], which is -2. The second command returns the determinant of the 1x1 matrix, "M"=[Pi], which is Pi.
Examples
-2
3.14159265400000010
See Also
Matlab, Matlab[evalM], Matlab[getvar], Matlab[setvar]
Download Help Document