Creating a standalone application with dynamic data objects
8 次查看(过去 30 天)
显示 更早的评论
I have an application that processes input using data models that are in .mat files. I've added the models to the build using the -a flag; however, I'd like to let the user specify the models to use when they run the application. Ideally something like
./my_app data/folder/1 data/folder/2
where the inputs are the paths to the .mat files that get loaded using load(). Is it possible to specify the .mat files after the application has been compiled and distrubted, or does the Matlab Compiler require that the .mat files be added prior to compilation?
0 个评论
回答(1 个)
Walter Roberson
2014-3-17
The compiler does not require that the .mat files be added prior to compilation. However, if you use
load(filename)
instead of
result = load(filename)
then you may run into problems with variables that are to be loaded into the workspace. It is best to not "poof" new variables into place using load() or evalin() or assignin() or eval()
4 个评论
Walter Roberson
2014-3-17
Are you trying to import objects from the .mat file where you do not care what the actual objects are as long as they have some particular set of methods that your exe applies to them? If so then I do not know if it is possible to support that.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!