Filter löschen
Filter löschen

Supporting files are not working in deployed .exe

1 Ansicht (letzte 30 Tage)
rahul
rahul am 14 Jul. 2013
Hi
I have generated a package with some GUIs and functions and some supporting files like shapefiles, images etc.
But after deploying that package into .exe form, supporting shapefiles (.shp) files are not working. Then I have tried to use them by converting into matrix (.mat)file, but then also its not working.
Why MATLAB deployed .exe is not able to read .shp and .mat files?
Please help me out in this regard. Any sort of help is appreciated.
Thanks in advance.

Akzeptierte Antwort

Image Analyst
Image Analyst am 14 Jul. 2013
Chances are you didn't specify the full filename of the files and just ignored any folder and assumed the file will be in the same folder as the executable. Bad assumption. For this to even have a chance of working, you'd have to bundle the files with the executable with the -a option. The reason is that the executable you think you are running is not the real executable but a self-unarchiving program that unpacks the real executable somewhere else but does not copy everything else (like the special files you shipped) in that folder to there. Better is to put these files into a known folder, then use fullfile() to construct the full path name of the file, and use exist(fullFileName, 'file') to check that the file exists before you try to do anything with it. It's just robust programming.
  5 Kommentare
Friedrich
Friedrich am 17 Jul. 2013
Mhh, can you narrow down the line where it hangs or stops? (add some disp commands) Please compile it as console application and run it from a DOS prompt/shell in order to see any warning/error which might be thrown.
rahul
rahul am 17 Jul. 2013
Thanks friedrich and Image analyst. It worked now since i added the path for landareas.shp, earlier it was not included.
Thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Compiler 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!

Translated by