How can I deploy a matlab code that saves .mat files files to communicate between functions, and saves data in the local directory -
i wrote gui in matlab using guide , using data structure saved .mat file in local directory of matlab application. .mat file used transfer variables between different functions in gui, example, in beginning of function write
load data;
and have access variables stored before. trying create standalone application using matlab compiler, however, application not seem save matrix in local directory or of results in .mat format. there workaround? need .mat functionality analyze videos , save each frame data in seperate .mat file in folder create in local directory well.
when run compiled matlab application, .exe file unpacks temporary folder, , run there. within application, can access folder it's unpacked using command ctfroot
.
you can refer folders relative output of command, e.g. matfilefolder = fullfile(ctfroot, 'matfiles')
.
alternatively, might find easier, or more maintainable, use temporary folder store files. can path system's temporary folder command tempdir
, , create subfolder within that.
if need application behave differently when run in matlab vs when compiled, can use command isdeployed
, return true when compiled , false otherwise, , switch behaviour based on output.
Comments
Post a Comment