Online Help

All Products Maple MapleSim

This worksheet demonstrates how to write a Maplet application that functions similarly to the LinearAlgebra[VectorNorm] Maplet application available in the Maplets[Examples] package. It is designed for experienced Maple authors.

The VectorNorm Maplet application provides a graphical interface to the LinearAlgebra[VectorNorm] function.

The vector norm of a vector V is a function ||V|| that satisfies all the conditions of a norm.By using user input, this procedure returns the calling sequence required to find the vector norm or evaluates the result.

3. Whether the result is to be evaluated (or the calling sequence is to be returned).

Example Code

>

restart:

Invoke the Maplets Elements subpackage.

>

with(Maplets[Elements]):

Since it is not most efficient to enter a vector in a Maplet application, the Maplets[Examples][LinearAlgebra][VectorNorm] example Maplet application requires that the user include the vector as an input.For this example, the following vector is used.

>

V := <1, 3, 5, 7-I>;

This example displays a Maplet application that queries the user for the inputs required, and then processes the results.

The variable continue is used to determine whether a previous section failed as a result of errors in user input or a Cancel click in either Maplet application.

Once the result from the Maplet application has been returned, check if the user clicked Cancel (by checking for a NULL result) or OK.If the user selected OK, analyze the results. The user input need only be parsed if it is not one of the entries already on the combo box.If the user indicates that the vector has real entries, then the conjugate option need not be set.

Finally, we set the options, and assign the answer depending on whether the user requested an evaluation.For this example, since answer is global, it evaluates fully. The extra level of unevaluation quotes is not necessary inside a procedure.

Maplesoft™, a subsidiary of Cybernet Systems Co. Ltd. in Japan, is the leading provider of high-performance software tools for engineering, science, and mathematics. Its product suite reflects the philosophy that given great tools, people can do great things.