Example: The Magic Square Calculator On the Web

Category : Matlab Builder NE

To create the Magic Square Calculator using .NET, you must create:

  1. The MATLAB Builder NE DLL file that is generated by compiling M-code using MATLAB, MATLAB Compiler, and MATLAB Builder NE.
  2. The DataTable implementation that converts the magic square output into something that an ObjectDataSource can use in a GridView Control.
  3. The ASPX page and the code behind it. This page is responsible for taking in user input, displaying the controls, and handling page events.

1. create .net package

project name: Examples.prj

class name: MagicCalc

m files included: getMagic.m and get MagicWebFigure.m

2. create a c# project

3.create DataTable implementation. to do this create a .cs file and save it under /App_Code as MagicSquare.cs

save the source code and place it on the cs file

4.Create the code for the ASPX page – copy the source code

on this page I removed some of the codes..3 lines, some weird codes that give errors

5. Create the code behind the ASPX page – copy the source code

6. don’t forget to add references: ¬†examples.dll, mwarray.dll

here’s a successful one:

http://202.185.107.147/GetMagicWebFigure/default.aspx

Post a comment