필터 지우기
필터 지우기

GUI GUIDE Error with Map

조회 수: 2 (최근 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에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by