Why are shapefile data files not included when compiling a MATLAB function for mapping toolbox functions that use them using the MATLAB Compiler?
Show older comments
I have a MATLAB function that utilizes the "usastatelo.shp" shapefile to plot the map of the all the states in the US. The contents of the function file are shown below:
function test
figure; ax = usamap('conus');
set(ax, 'Visible', 'off');
states = shaperead('usastatelo', 'UseGeoCoords', true,'Selector',{@(name) ~any(strcmp(name,{'Alaska','Hawaii'})), 'Name'});
names = {states.Name};
indexConus = 1:numel(states);
stateColor = [0.5 1 0.5];
geoshow(ax(1), states(indexConus), 'FaceColor', stateColor);
In order to deploy this code onto a machine which does not have MATLAB installed, I use the MCC command:
mcc -m test
to create a stand-alone executable, using the MATLAB Compiler.
However, when I try to test the executable by running the following command from the MATLAB command prompt:
!test
I receive the following error message:
ERROR: Error in ==> mapformats\private\openShapeFiles at 19
Error in ==> shaperead at 204
Error in ==> example_track at 5
??? Error using ==> mapformats\private\openShapeFiles>checkSHP
Failed to open both usastatelo.shp and usastatelo.SHP.
map:openShapeFiles:failedToOpenSHP1
Accepted Answer
More Answers (0)
Categories
Find more on Application Deployment 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!