Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to close wrl in gui

4 次查看(过去 30 天)
Taewa kaewplang
Taewa kaewplang 2012-5-12
关闭: MATLAB Answer Bot 2021-8-20
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
cc = vrworld('cube.wrl');
open(cc);
c1 = vr.canvas(cc, gcf,[200 240 320 240]);
set(c1,'Units','normalized')
guidata(hObject, handles);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
close(cc);
Can't working
Help Please ...

回答(2 个)

Walter Roberson
Walter Roberson 2012-5-12
open() requires an argument that is the name of a file or variable.
Perhaps you want open(cc)

Taewa kaewplang
Taewa kaewplang 2012-5-12
function pushbutton1_Callback(hObject, eventdata, handles)
myworld = vrworld('cube.wrl');
open(myworld);
c1 = vr.canvas(myworld, gcf,[200 240 320 240]);
set(c1,'Units','normalized')
guidata(hObject, handles);
% --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles)
close(myworld)
guidata(hObject, handles);
??? Error while evaluating uicontrol Callback
??? Undefined function or variable 'myworld'.
Error in ==> wrlddd>pushbutton2_Callback at 95 close(myworld)
Can't working
Pass the button2 is not working. Not Close wrl
  1 个评论
Walter Roberson
Walter Roberson 2012-5-12
"myworld" is local to the workspace of pushbutton1_Callback
Please read through
http://matlab.wikia.com/wiki/FAQ

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by