Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
MTM[struct] - record constructor
Calling Sequence
struct(name1,value1,name2,value2,...);
Parameters
namei
-
name or string
valuei
any expression
Description
The struct command creates a Maple record. A record is a fixed-size collection of items addressable by name. Accessing individual field values is done via the :- or [] operators. For example MyStruct:-field1 will give you value1 as does MyStruct[field1].
The :- operator binds more tightly than [], avoiding evaluation if the name field1 happens to have another meaning in the given scope. Conversely, [] allows evaluation to happen, which allows for name resolution, and iteration over individual fields via the exports command.
The struct command is essentially a front end to the Record command. Aside from the different calling sequence, the struct command differs from the Record command in that it adds a ModulePrint definition so the record is displayed nicely.
Examples
See Also
exports, ModulePrint, MTM, Record
Download Help Document