Problem using a .mat file with a standalone application (.exe)
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello everyone,
I am trying to create an application to detect some pattern in EEG data. To do so, I did some classification learning (in the Classification Learner app) and exported the model so I can use it with new data. The model is exported as ModelLvl2.mat.
Then I created the application with Matlab GUI and every works perfectly when I test it with the .m file. But when I create the .exe file to launch the application, it won't work any more. When I used Matlab Compiler to create the .exe I did precise that ModelLvl2.mat was one of the files required for my application to run so it should be included in the .exe.
The file I want to use is called ModelLvl2.mat and I need to access ModelLvl2.ClassificationSVM. Here is my code :
load('ModelLvl2.mat');
model = ModelLvl2.ClassificationSVM;
labels = predict(model, data);
When I use the .exe everything works except that. I did some tests and found that the application loads ModelLvl2.mat file alright and it even contains ClassificationSVM. But inside ClassificationSVM there should be some more stuff and this stuff is not present with the .exe.
l = length(fieldnames(model))
It returns 0 with the .exe but it should normally return 33.
It would really help if someone had a solution to my problem. Thank you in advance !
0 Kommentare
Antworten (1)
Image Analyst
am 11 Jul. 2017
It's a path problem. You did not specify the complete path of your mat file so it's looking in the current folder. However the current folder is not where you think it is (where you installed the executable). Try to specify the full path.
If that doesn't work, try the dozen things in the FAQ: http://matlab.wikia.com/wiki/FAQ#My_standalone_executable_won.27t_run_on_the_target_computer._What_can_I_try.3F
2 Kommentare
Image Analyst
am 16 Jul. 2017
Bearbeitet: Image Analyst
am 16 Jul. 2017
DO NOT use path as the name of a variable. It is a VERY IMPORTANT variable that you definitely do not want to overwrite/destroy. Choose another name. If that doesn't work, you may have to call tech support.
Siehe auch
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!