0
votes

I'm trying to insert a map into MATLAB's GUI GUIDE and I'm getting the error:

Error while evaluating uicontrol Callback

The map does work when I run it standalone in the command window but when I push the button in GUIDE, it appears then gets distorted, and then I get an error.

Here is my code:

function temp_button_Callback(hObject,eventdata,handles)
lat = [80 45 52; 45 46 34]
long = [123 132 123; 120 122 119]
temp = [67 68 69; 71 72 73]

axesm('mercator','MapLatLimit',[-50 90],'MapLonLimit',[0 250])
framem on; gridm on;
load coast;
mlabel on;
plabel on;
plotm(lat,long,'k')


contourfm(long,lat,temp)
1

1 Answers

0
votes

You've got clear lat long; right before contourfm(long,lat,temp). Clearly you still need those variables, so don't clear them.