MATLAB: Vrealm canvas inside a panel in guide

guidevrealm

How to implement a vrealm world canvas inside a gui uipanel that i created in the guide editor.
I tried :
World = vrworld(vrml1.wrl, 'new') ;
Open(world) ;
Vrcanvas = vr.canvas(world,handles.uipanel1);
But that did not work. Also tried :
Vrcanvas = vr.canvas(world,get(handles.uipanel1) );
But that did not work either. Can you please help me get the syntax right.

Best Answer

myCanvas = vr.canvas(World, 'Parent', handles.uipanel1, 'Units',...
'normalized', 'Position', [0 0 1 1]);
Note: watch out for World (what you assigned to) compared to world (which you used within initializing)