MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Manual do Utilizador Página 14: Compile the M-file
Writing the M-file
The first step is writing the MATLAB M-file that you want to share. For this example, write a simple application that
takes a filename and a String and writes the String out to a file with the given name. This application consists of the
following lines:
% write the variable whatToWrite to a file called filename in the current
directory
fid = fopen(filename,'w');
fprintf(fid,'#writing to a file\n\n');
fprintf(fid,whatToWrite);
fclose(fid);
Adapting the M-file
To call the M-file from the command line and pass it parameters, you must turn this script into a no-return function. To
do this, add a function definition line at the start of the M-file and save the file using the name of the function (for
example, writeToFile.m).
function writeToFile( filename, whatToWrite)
% write the parameter whatToWrite to a file called filename in the current
directory
fid = fopen(filename,'w');
fprintf(fid,'#writing to a file\n\n');
fprintf(fid,whatToWrite);
fclose(fid);
Compile the M-file
Within the MATLAB environment, call the MATLAB Compiler to convert this function into an application:
>> mcc -m writeToFile
Within the current working directory, this creates a number of files, including the following:
●
writeToFile.exe (Windows) or
writeToFile (Linux, Mac OS X)
●
writeToFile.ctf
Note:
To use the MATLAB compiler on Mac OS X, you must have Xcode 2.2 installed; minimally, the Developer
Tools, gcc 4.0, gcc 3.3, Mac OS X SDK, and BSD SDK. These instructions were tested using Xcode 2.2.1.
Prepare the GenePattern Server
Install the MATLAB Component Runtime (MCR) on the GenePattern server, if you have not done so already. If the
GenePattern server has MATLAB installed, it also has the MCR installed.
Windows
To install the MCR:
1.
Copy
<matlabroot>\toolbox\compiler\deploy\win32\MRCInstaller.exe
to the
GenePattern server machine.
2.
At the DOS prompt, or from Windows Explorer, run the following:
MCRInstaller.exe
Linux or Mac OS X
To install the MCR:
1.
Within the MATLAB environment, create the MCRInstaller zip file:
>> buildmcr mcrdir
This creates a directory,
mcrdir
, beneath the current working directory and creates a file within that directory
called
MCRInstaller.zip
.
14
Ficheiro PDF · ·
Perguntas sobre MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE
Ainda não há perguntas sobre este manual. Faça a primeira.
Manuais e produtos relacionados com Software MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE
- Software MATLAB CURVE FITTING TOOLBOX - RELEASE NOTES Manual do Utilizador
(54 páginas) - Software MATLAB GAUGES BLOCKSET RELEASE NOTES Guia do Utilizador
(114 páginas) - Software MATLAB EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO Especificações
(126 páginas) - Software MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Especificações
(216 páginas) - Software MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Guia do Utilizador
(386 páginas) - Software MATLAB BUILDER EX 1 Guia do Utilizador
(164 páginas) - Software MATLAB DATABASE TOOLBOX RELEASE NOTES Manual do Utilizador
(37 páginas) - Software MATLAB VIDEO AND IMAGE PROCESSING BLOCKSET 3 Guia do Utilizador
(252 páginas) - Software MATLAB SYSTEMTEST RELEASE NOTES Guia de Instalação
(237 páginas) - Software MATLAB TARGET SUPPORT PACKAGE - RELEASE NOTES Manual do Utilizador
(54 páginas) - Software MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual de Serviço
(282 páginas) - Software MATLAB PARTIAL DIFFERENTIAL EQUATION TOOLBOX 1 Manual do Utilizador
(18 páginas) - Software MATLAB IMAGE ACQUISITION TOOLBOX - RELEASE NOTES Guia do Utilizador
(574 páginas) - Software MATLAB IMAGE ACQUISITION TOOLBOX 3 Guia do Utilizador
(408 páginas) - Software MATLAB XPC TARGET RELEASE NOTES Manual do Utilizador
(51 páginas) - Software MATLAB TARGET SUPPORT PACKAGE - RELEASE NOTES Manual do Utilizador
(42 páginas) - Software MATLAB BUILDER JA 2 Guia do Utilizador
(292 páginas) - Software MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Guia do Utilizador
(210 páginas) - Software MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guia do Utilizador
(759 páginas) - Software MATLAB CONTROL SYSTEM TOOLBOX 9 Especificações
(591 páginas)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22