MATLAB: Do App Designer components disappear when I insert them in the canvas

component-disappearingMATLABshadowing

I am trying to create an app using App Designer. When I insert specific components, such as UIAxes or radio buttons, they immediately disappear from the canvas and I get the following error message:
Not enough input arguments.
Error in split (line 20)
if ( flag == 1 ), % jacobi splitting
Error in appdesigner.internal.componentadapterapi.VisualComponentAdapter/getComponentDesignTimeController (line 360)
componentName = split(componentType, '.');
Error in appdesigner.internal.componentmodel.DesignTimeComponentFactory.createController (line 31)
controllerClass = adapterInstance.getComponentDesignTimeController();
Error in appdesigner.internal.componentmodel.DesignTimeComponentFactory/createComponent (line 127)
DesignTimeComponentFactory.createController(componentType, component, ...
Error in appdesigner.internal.componentmodel.DesignTimeComponentFactory/createModel (line 17)
component = DesignTimeComponentFactory.createComponent(componentType, parentModel, peerNode);
Error in appdesservices.internal.interfaces.controller.DesignTimeParentingController/processClientCreatedPeerNode (line 193)
child = obj.Factory.createModel(obj.getModel(),peerNode);
Error in appdesservices.internal.interfaces.controller.DesignTimeParentingController/handlePeerNodeAdded (line 270)
obj.processClientCreatedPeerNode(peerNode);
Error in appdesservices.internal.interfaces.controller.DesignTimeParentingController>@(varargin)obj.handlePeerNodeAdded(varargin{:}) (line 137)
obj.ChildAddedListener = addlistener(obj.ProxyView.PeerNode,'childAdded', @obj.handlePeerNodeAdded);
Error in hgfeval (line 62)
feval(fcn{1},varargin{:},fcn{2:end});
Error in javaaddlistener>cbBridge (line 52)
hgfeval(response, java(o), e.JavaEvent)
Error in javaaddlistener>@(o,e)cbBridge(o,e,response) (line 47)
@(o,e) cbBridge(o,e,response));
Warning: Error occurred while evaluating listener callback.
Why is this happening?

Best Answer

This issue occurs when a MATLAB built-in function used by App Designer is shadowed by a user-created function with the same name. In this case, the issue applies to the function "split".
To confirm that this is the root cause, execute the following in the MATLAB Command Window:
>> which -all split
The very first result of this command should be \matlab\toolbox\matlab\strfun\split.m. If this is not the first result, then the root cause is that another function with the same name is shadowing the built-in 'split' function. To fix this, execute the following MATLAB commands:
>> restoredefaultpath;
>> rehash toolboxcache;