[VCLab-Main] [Software][HotEqn][Interactive Equations]
mHotEqn is able to replace expressions with matrix data from the MATLAB workspace. MATLAB statements or m-files can be executed on demand by clicking with the left mouse button in the applet windows. Below, between this text and the Example heading is a tiny hidden window of the MATLAB Plugin, which is necessary to be embedded for MATLAB communication purposes.
Example:
| First, clicking on this equation will define an A-matrix. Observe the red matrix below. |
Clicking with the left mouse button on this
equation will execute the MATLAB statement |
| Clicking on this equation will show the current A-matrix. |
Clicking with the left mouse button on this
equation will examine the MATLAB workspace for the matrix |
| Clicking on this equation will perform the calculation according to this formula. |
Clicking with the left mouse button on this
equation will execute the MATLAB m-file calca.m, which modifies the matrix |
| This applet window will show the current A-matrix every 3 seconds. |
This applet examines the MATLAB workspace for the
matrix |
Let's have a look at the HTML code of this example.
First, clicking on this equation will define
<applet code=mHotEqn.class height=35 width=300 name="definition of A" align=absmiddle MAYSCRIPT>
<param name="leftside" value="A">
<param name="rightside" value="\mbox{eye}(4,4);">
<param name="mEvalString" value="A=eye(4,4);">
</applet>
an A-matrix. Observe the red matrix below.
Clicking on this equation
<applet code=mHotEqn.class height=115 width=300 name="get A" align=absmiddle MAYSCRIPT>
<param name="leftside" value="y">
<param name="rightside" value="\fgcolor{004000}{\sum_{i=0}^{5}\sin\left(x+2\right)^i}">
<param name="mGetArray" value="A">
</applet>
will show the current A-matrix.
Clicking on this equation will perform
<applet code=mHotEqn.class height=35 width=300 name="calculate A" align=absmiddle MAYSCRIPT>
<param name="equation" value="A\;\Leftarrow\;2\;\ast\;A">
<param name="mEvalMFile" value="calca.m">
</applet>
the calculation according to this formula.
This applet window will show
<applet code=mHotEqn.class height=115 width=300 name="update A periodically" align=absmiddle MAYSCRIPT>
<param name="mGetArray" value="A">
<param name="update" value="3000">
</applet>
the current A-matrix every 3 seconds.
|
Description:
The first applet uses the mEvalString parameter to execute the MATLAB statement A=eye(4,4);. The third applet is similar to this, but uses the mEvalMFile parameter to execute the m-file calca.m. As no path is given to this file, it must be located on the directory of this document.
The second applet retrieves the matrix A from the MATLAB workspace using the mGetArray parameter. The fourth applet has the same functionality but additionally with periodic updating. Thus the parameters are the same plus the update parameter, which specifies an update interval of 3000 milliseconds.
[VCLab-Main] [Software][HotEqn][Interactive Equations]