Standalone application cannot read p-code?
Show older comments
So my app has an input library that is not bundled together with the app itself. I want to be able to share only specific inputs with other users. These input files are in the customized .x format (this is just a name, in reality they are merely p-code). This is done so that the end user cannot change the values.
This code converts the .x file back to .p and then reads it.
function LoadDataButtonPushed(app, event)
[filename, folder] = uigetfile ({'*x'});
if ~ischar(filename); return; end %user cancel
filename = fullfile(folder, filename);
tf = tempname + ".p";
copyfile(filename, tf);
cleanMe = onCleanup(@() delete(tf));
run(tf);
clear cleanME %delete file
%run (filename);
end
Everything works within matlab but when I run the standalone app, I get this error:
Error using run (line 68)
RUN cannot execute the file 'C:\User\AppData\Local\Temp\tp5c2adeb2_27cb_4c29_a65b_a473ebe3e346.p'. RUN requires a valid MATLAB script
Error in A2P2/LoadDataButtonPushed (line 497)
Error in appdesigner.internal.service.AppManagementService/tryCallback (line 369)
Error in matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) (line 37)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 410)
Error while evaluating Button PrivateButtonPushedFcn.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!