User`s guide

6 Standalone Applications
mrank.m
mrank.m contains a function that returns a vector of the ranks of the magic
squares from 1 to n.
function r = mrank(n)
r = zeros(n,1);
for k = 1:n
r(k) = rank(magic(k));
end
Copy mrank.m, printmatrix.m, mrankp.c, main_for_lib.c,and
main_for_lib.h into your current directory.
Build Process
The steps needed to build this standalone application are
1 Compile the M-code.
2 Generate the library wrapper file.
3 Create the b inary .
To perfo rm these steps, enter the follo wing on a single line:
mcc -W lib:libPkg -T link:exe mrank printmatrix mrankp.c
main_for_lib.c
The following flow diagram shows the mixing of M-files and C-files that forms
this sample standalone application. The top part of the diagram shows the
mcc process and the lower part shows the mbuild process.
6-14