카테고리 없음2013. 4. 11. 01:06

MATLAB Compiler generated exe's can't read/use plain m files.

The only way to have interchangeable data is through a file, e.g. mat file.

 

 

Compiled Applications Do Not Process MATLAB Files at Runtime

The MATLAB Compiler was designed so that you can deploy locked down functionality. Deployable MATLAB files are suspended or frozen at the time MATLAB Compiler encrypts them—they do not change from that point onward. This does not mean that you cannot deploy a flexible application—it means that you must design your application with flexibility in mind. If you want the end user to be able to choose between two different methods, for example, they both must be compiled in.

The MCR only works on MATLAB code that was encrypted when the component was built. Any function or process that dynamically generates new MATLAB code will not work against the MCR.

Some MATLAB toolboxes, such as the Neural Network Toolbox™ product, generate MATLAB code dynamically. Because the MCR only executes encrypted MATLAB files, and the Neural Network Toolbox generates unencrypted MATLAB files, some functions in the Neural Network Toolbox cannot be deployed.

Similarly, functions that need to examine the contents of a MATLAB function file cannot be deployed.HELP, for example, is dynamic and not available in deployed mode. You can use LOADLIBRARY in deployed mode if you provide it with a MATLAB function prototype.

Instead of compiling the function that generates the MATLAB code and attempting to deploy it, perform the following tasks:

  1. Run the code once in MATLAB to obtain your generated function.

  2. Compile the MATLAB code with MATLAB Compiler, including the generated function.

Tip: Another alternative to using EVAL or FEVAL is using anonymous function handles. If you require the ability to create MATLAB code for dynamic run time processing, your end users must have an installed copy of MATLAB.

 

 

 

The only way is using mat file...

 [FileName,PathName] = uigetfile('*.mat','Prepare mat file'); % a is in the .mat file

fullname = fullfile(PathName,FileName);

load(fullname) 

set(handles.text1,'String',num2str(a(1:end)))

 

 

 

Posted by 오늘보다 나은 내일