MATLAB BUILDER JA 2 User's Guide Page 30

  • Download
  • Add to my manuals
  • Print
  • Page
    / 292
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 29
1 Getting Started
When you run the program you pass an argument representing the dimension
for the magic square. In this example, the v alue for the dimension is
5.
The program converts the number passed on the command line to a scalar
double value, creates an instance of class magic, and calls the makesqr
method on that object. The method computes the square using the MATLAB
magic function.
The
getmagic program should display the following output:
Magic square of order 5
17 24 1 8 15
23571416
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
1-22
Page view 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 291 292

Comments to this Manuals

No comments