I am a bit confused about the matlab, sry that I could not find a better title.
I have the following structure
testit.m
+package
testfile.m
testit.m contains:
import package.testfile
testfile
testfile.m contains:
view = struct();
v = uiextras.Grid( 'Spacing', 5 );
view.view = v;
view.axes = axes( 'Parent', view.view );
If i now cd into the base directory and type testit I get the the following error:
??? Error using ==> axes
Conversion to double from unknown is not possible.
Error in ==> testfile at 4
view.axes = axes( 'Parent', view.view );
Error in ==> testit at 3
testfile
So far so good. But if I do not put testfile.m into the package and call it directly via testfile.m everything works fine. If I replace the last line of testfile.m with
view.axes = axes( 'Parent', v );
such that I don't use the struct to access the Grid, I get the error:
??? No method 'onChildAddedEvent' with matching signature found for class 'uiextras.Grid'.
Error in ==> Container>@(varargin)obj.onChildAddedEvent(varargin{:}) at 95
obj.Listeners{end+1,1} = handle.listener( containerObj, 'ObjectChildAdded', @obj.onChildAddedEvent );
Warning: Error occurred while evaluating listener callback.
> In testfile at 4
In testit at 3
uiextras comes from http://www.mathworks.com/matlabcentral/fileexchange/27758
Why does it make a difference wether I put the file into a package or not? Why does it make a difference wether I use v or view.view? Do I just misunderstand the matlab syntax?
testfile.malso work fine if you do aclear allbefore you call it?