GUI GUIDE Error with Map

1 次查看(过去 30 天)
Amanda
Amanda 2012-8-23
I'm trying to insert a map into the 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)
Thanks,
Amanda

采纳的回答

Matt Fig
Matt Fig 2012-8-23
编辑:Matt Fig 2012-8-23
You clear long and lat, then immediately try to use them. This is your error. You also rely on Poofing variables into your workspace... This is a very bad habit you should break while the debugging is easy!
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;
X = load('coast'); % No variable Poofing!!
mlabel on;
plabel on;
plotm(X.lat,X.long,'k')
contourfm(long,lat,temp)
  13 个评论
Amanda
Amanda 2012-8-23
Thanks so mush for helping me. Let try this. I've been at this for 3 hours.
Amanda
Amanda 2012-8-23
That is it. Thanks so much!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by