18 fname =
" typecastx ";
20 disp([
" Detected that the mex routine for " fname
" is not yet built. "]);
21 disp(
" Attempting to do so now ... ");
24 mname = mfilename(
" fullpath ");
28 cname = [mname
" .c "];
29 if( isempty(dir(cname)) )
30 disp([
" Cannot find the file " fname
" .c in the same directory as the "]);
31 disp([
" file " fname
" .m. Please ensure that they are in the same "]);
32 disp(
" directory and try again. The following file was not found: ");
36 error([
" Unable to compile " fname
" .c "]);
38 disp([
" Found file " fname
" .c in " cname]);
40 disp(
" Now attempting to compile ... ");
41 disp(
" (If prompted, please press the Enter key and then select any C/C++ ");
42 disp(
" compiler that is available, such as lcc.) ");
44 disp([
" mex( " cname
" , "" -output "" , ",mname,
" ) "]);
47 mex(cname,
" -output ",mname);
48 disp([ fname
" mex build completed ... you may now use " fname
" . "]);
52 error([
" Unable to compile " fname
" ... Contact author. "]);
A variable number of input arguments.
function varargout = typecastx(varargin)
A variable number of output arguments.