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
Programmatic Spreadsheet Access
This worksheet demonstrates some of the features of the Spread package. This package is intended to provide support for accessing Maple spreadsheets programmatically. As you read this worksheet, you should execute the commands in sequence as you come to them.
Accessing the Spread Package
To use the Spread package, you must first issue the following call to the procedure with, which provides interactive access to procedures organized into packages.
The routines exported by the Spread package are now available for interactive use. The procedures available in the package are displayed as the result of the with command.
Creating Spreadsheets
The first task with which you must become acquainted is the programmatic creation of spreadsheets. When a spreadsheet is created, it is given a name. The procedure CreateSpreadsheet is provided for programmatic control of spreadsheet creation. The name of the spreadsheet is returned. You must use this name to refer to the spreadsheet in subsequent calls to Spread package procedures.
Now, the variable ssid is assigned the name of the spreadsheet that was created by executing the preceding command.
When no argument are provided, CreateSpreadsheet returns a system-generated name for the spreadsheet. You can also specify your own name for the spreadsheet by providing that name as an argument to the call to CreateSpreadsheet. If you create a spreadsheet by using the Insert, Spreadsheet menu item, you can determine its name by opening the Properties dialog box that is accessible from the context-sensitive menu for the spreadsheet.
Selecting Cells
Every spreadsheet has, at all times, a "current selection". This refers to the box-shaped region of cells that are visually distinguished from those that do not belong to the selection. Many of the Spread package procedures operate on and allow you to manipulate the current spreadsheet selection.
Try changing the selected region before executing the following command. You can re-execute this command after selecting different cells with the mouse.
This command will copy the selection from the spreadsheet above to the spreadsheet MySpreadsheet that was created earlier.
Evaluating Cells and Manipulating Cell Data
You can evaluate either an entire spreadsheet, or just the current selection (which you can set using the procedure SetSelection), by using the commands EvaluateSpreadsheet and EvaluateCurrentSelection, respectively.
The command GetCellValue will retrieve the (displayed) value from a specified cell. The formula stored in a given cell can be queried by using the command GetCellFormula. By using SetCellFormula, you can set the formula of a cell (but not the cell value).
Performing Block Operations with Matrix Data
Sometimes it is convenient to manipulate entire blocks of data within a spreadsheet. Such blocks can be represented in Maple using matrices. Certain commands in the Spread package allow you to manipulate spreadsheet data in a blockwise fashion, using matrices.
The Procedure SetMatrix inserts a matrix of values into a spreadsheet. Blocks of data can be extracted from a spreadsheet by using the commands GetValuesMatrix and GetFormulaeMatrix. You can import matrix data into a spreadsheet selection, with clipping, by using the command InsertMatrixIntoSelection.
Return to Index for Example Worksheets
Download Help Document