MATLAB BUILDER JA 2 Guide de l'utilisateur Page 23

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 292
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 22
Example: Magic S quare
Example: Magic Square
This example shows you how to:
Access the online examples provided with MATLAB Builder for Java.
Use MATLAB Builder f or Java to encapsulate a simple MATLAB function
in a Java component.
Use the MWArray class library to handle data conversion in a sample
application.
About the Examples The examp les for MATLAB Builder for Java are in
matlabroot\toolbox\javabuilder\Examples.
The Magic Square example shows you how to create magicsquare,aJava
component, which contains the
magic class. The class encapsulates a
MATLAB function,
makesqr, which computes a magic square. It represents
the magic square as a two-dimensional array.
Thesampleapplication,
getmagic, does the following:
Displaysthearrayreturnedbythe
makesqr method
Converts the array returned by
makesqr to a native array and displays it
When you run the
getmagic application from the command line, y ou can p ass
the dimension for the magic square as a command-line argument.
Magic Square Example: Step-by-Step Procedure
1 If you have not already done so, set the environment variables that are
required on a d ev elo pm ent machine. See “Settings for Environment
Variables (Development M achine)” on page 6-2.
2 If you have no
t a lready done so, copy the files for this example as follows:
a. Copy the foll
owing d irectory that ships with MATLAB to your work
directory:
1-15
Vue de la page 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 291 292

Commentaires sur ces manuels

Pas de commentaire