Problem with intrinsic functions?

I'm getting the following error at various points in my script that work with plots. I've been working with this code for a a few years but I haven't touched it in about 6 months. Any idea why I'm having issues with matlab graphics?
Not enough input arguments.
Error in isgraphics (line 3)
out = ishandle(h) && strcmpi(get(h,'type'),type);
Error in matlab.graphics.internal.markFigure (line 6)
if isgraphics(obj)
Error in hold (line 36)
matlab.graphics.internal.markFigure(ax);
EDIT: It is important to note that this error occurs whenever I am dealing with an open plot. For example, when adding error bars, turning on the grid, or even adding a title. Stephen Cobeldick requested the full text of the error in the comments but I could provide 5+ complete error messages that are rooted in the same errors above.

댓글 수: 4

Stephen23
Stephen23 2018년 9월 19일
@Brooke Sarley: please show the complete error message. This means all of the red text.
Brooke Sarley
Brooke Sarley 2018년 9월 19일
편집: Brooke Sarley 2018년 9월 19일
Yes, here is an example:
Not enough input arguments.
Error in isgraphics (line 3)
out = ishandle(h) && strcmpi(get(h,'type'),type);
Error in matlab.graphics.internal.markFigure (line 6)
if isgraphics(obj)
Error in hold (line 36)
matlab.graphics.internal.markFigure(ax);
Error in strain_calc (line 337)
hold on; plot(fit1,'predfunc',0.90);
Error in main_code (line 508)
strain_calc;
However, my original message showed the part of the error that happens regardless of the primary two messages of the error
I am having a similar problem.
K>> load mri
K>> montage(D,map)
Not enough input arguments.
Error in isgraphics (line 3)
out = ishandle(h) && strcmpi(get(h,'type'),type);
Error in cla (line 40)
elseif isscalar(ax) && isgraphics(ax)
Error in newplot>ObserveAxesNextPlot (line 152)
cla(ax, 'reset', hsave);
Error in newplot (line 93)
ax = ObserveAxesNextPlot(ax, hsave);
Error in imshow (line 293)
ax_handle = newplot;
Error in montage (line 222)
hh = imshow(bigImage,cmap,parentArgs{:});
Walter Roberson
Walter Roberson 2018년 11월 20일
what shows up for
which -all isgraphics

댓글을 달려면 로그인하십시오.

답변 (1개)

Steven Lord
Steven Lord 2018년 9월 19일

0 개 추천

Make sure that you haven't written your own functions with names that match those included in MATLAB. From that line of code in isgraphics called out at the top of the error message I suspect you've written a function named ishandle.m, strcmpi.m, or (most likely IMO) get.m.
which -all ishandle
which -all strcmpi
which -all get
If you have, please rename your function.

댓글 수: 5

Brooke Sarley
Brooke Sarley 2018년 9월 19일
No I did not. ishandle is called from within isgraphics... which is an intrinsic function. To reiterate: Only the first two functions in my response to Stephen are my own (main_code and strain_calc).
Steven Lord
Steven Lord 2018년 9월 19일
The purpose of those three lines of code I posted are to show that the ONLY functions named ishandle, strcmpi, and get accessible to MATLAB are the ones that are provided by MathWorks. It's easy to accidentally reuse a name or to install some other add-on that introduces a function with a name that conflicts with the functions provided by MathWorks. I'm trying to eliminate that possibility, and the output of those which calls should do that.
Brooke Sarley
Brooke Sarley 2018년 9월 19일
I understand your point and when entered into the command window they each return "built-in [toolbox location]", except for get, which is included in a few toolboxes. I also haven't installed any add-ons and this code was running fine as of March of this year (on the same 2016a install)
in R2016a, isgraphics is a built-in function that does not have source available. If it is misused, the traceback for it will not show a line number and will not show a line of text.
You should check
which -all isgraphics
Here is the result of the various "which" commands suggested in these comments (I am getting a similar error to the person asking the question).
K>> which -all isgraphics
C:\Users\..\mtex-5.1.1\compatibility\8.4\isgraphics.m
built-in (C:\Program Files\MATLAB\R2018b\toolbox\matlab\graphics\isgraphics) % Shadowed
K>> which -all ishandle
built-in (C:\Program Files\MATLAB\R2018b\toolbox\matlab\graphics\ishandle)
K>> which -all strcmpi
built-in (C:\Program Files\MATLAB\R2018b\toolbox\matlab\strfun\strcmpi)
C:\Program Files\MATLAB\R2018b\toolbox\matlab\strfun\@opaque\strcmpi.m % Shadowed opaque method
strcmpi is a built-in method % Shadowed connector.internal.LoggerLevel method
strcmpi is a built-in method % Shadowed connector.internal.PromiseState method
strcmpi is a built-in method % Shadowed mtree.Type method
strcmpi is a built-in method % Shadowed matlab.internal.editor.ErrorType method
strcmpi is a built-in method % Shadowed matlab.graphics.interaction.graphicscontrol.layoutable.LayoutableControlEnums method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\bigdata\@tall\strcmpi.m % Shadowed tall method
C:\Program Files\MATLAB\R2018b\toolbox\distcomp\parallel\@codistributed\strcmpi.m % Shadowed codistributed method
K>> which -all get
built-in (C:\Program Files\MATLAB\R2018b\toolbox\matlab\graphics\get)
get is a built-in method % Shadowed matlab.ui.internal.mixin.Printable method
get is a built-in method % Shadowed matlab.ui.internal.mixin.Windowable method
get is a built-in method % Shadowed matlab.ui.Figure method
get is a built-in method % Shadowed matlab.ui.internal.mixin.AutoResizable method
get is a built-in method % Shadowed matlab.ui.internal.mixin.AxesLimits method
get is a built-in method % Shadowed matlab.ui.internal.mixin.Legacy method
get is a built-in method % Shadowed matlab.ui.internal.mixin.FontRenderable method
get is a built-in method % Shadowed matlab.ui.internal.mixin.KeyInvokable method
get is a built-in method % Shadowed matlab.ui.internal.mixin.NoMarginsUnitsOnlyPositionable method
get is a built-in method % Shadowed matlab.ui.internal.mixin.Positionable method
get is a built-in method % Shadowed matlab.ui.internal.mixin.Scrollable method
get is a built-in method % Shadowed matlab.ui.internal.mixin.Selectable method
get is a built-in method % Shadowed matlab.ui.internal.mixin.TerminalStateRepresentable method
get is a built-in method % Shadowed matlab.ui.Root method
get is a built-in method % Shadowed matlab.ui.control.ClientComponent method
get is a built-in method % Shadowed matlab.ui.control.Component method
get is a built-in method % Shadowed matlab.ui.container.Container method
get is a built-in method % Shadowed matlab.ui.container.CanvasContainer method
get is a built-in method % Shadowed matlab.ui.control.WebComponent method
get is a built-in method % Shadowed matlab.ui.control.UIControl method
get is a built-in method % Shadowed matlab.ui.container.Menu method
get is a built-in method % Shadowed matlab.ui.container.toolbar.PushTool method
get is a built-in method % Shadowed matlab.ui.container.toolbar.ToggleTool method
get is a built-in method % Shadowed matlab.ui.internal.mixin.UIToggleToolMixin method
get is a built-in method % Shadowed matlab.ui.internal.mixin.UIToolMixin method
get is a built-in method % Shadowed matlab.ui.container.Toolbar method
get is a built-in method % Shadowed matlab.graphics.Graphics method
get is a built-in method % Shadowed matlab.graphics.GraphicsPlaceholder method
get is a built-in method % Shadowed matlab.graphics.internal.GraphicsPropertyHandler method
get is a built-in method % Shadowed matlab.graphics.internal.ReferenceObject method
get is a built-in method % Shadowed matlab.graphics.mixin.GraphicsPickable method
get is a built-in method % Shadowed matlab.graphics.mixin.Mixin method
get is a built-in method % Shadowed matlab.graphics.mixin.NodeChildren method
get is a built-in method % Shadowed matlab.graphics.mixin.NodeParent method
get is a built-in method % Shadowed matlab.graphics.mixin.Pickable method
get is a built-in method % Shadowed matlab.graphics.mixin.Selectable method
get is a built-in method % Shadowed matlab.graphics.internal.GraphicsBaseFunctions method
get is a built-in method % Shadowed matlab.graphics.internal.GraphicsUIProperties method
get is a built-in method % Shadowed matlab.graphics.internal.GraphicsCoreProperties method
get is a built-in method % Shadowed matlab.graphics.internal.Legacy method
get is a built-in method % Shadowed matlab.mixin.SetGet method
get is a built-in method % Shadowed hgsetget method
get is a Java method % Shadowed java.util.ArrayList method
get is a Java method % Shadowed java.util.AbstractList method
get is a Java method % Shadowed java.util.List method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\connector2\framework\+connector\+internal\Future.p % Shadowed connector.internal.Future method
get is a Java method % Shadowed java.util.Collections$UnmodifiableRandomAccessList method
get is a Java method % Shadowed java.util.Collections$UnmodifiableList method
get is a built-in method % Shadowed javahandle_withcallbacks.com.mathworks.mwswing.MJFileChooserPerPlatform method
get is a built-in method % Shadowed handle.handle method
get is a built-in method % Shadowed handle.subreference__ method
get is a built-in method % Shadowed schema.class method
get is a built-in method % Shadowed schema.method method
get is a built-in method % Shadowed javahandle.com.mathworks.hg.peer.Echo method
get is a built-in method % Shadowed javahandle.com.mathworks.hg.peer.HG2FigurePeer method
get is a built-in method % Shadowed matlab.graphics.primitive.canvas.JavaCanvasFactory method
get is a built-in method % Shadowed matlab.graphics.primitive.canvas.JavaCanvas method
get is a built-in method % Shadowed matlab.graphics.axis.AbstractAxes method
get is a built-in method % Shadowed matlab.graphics.axis.Axes method
get is a built-in method % Shadowed matlab.graphics.axis.decorator.AxisDecoration method
get is a built-in method % Shadowed matlab.graphics.axis.decorator.AxisRulerBase method
get is a built-in method % Shadowed matlab.graphics.axis.decorator.Backdrop method
get is a built-in method % Shadowed matlab.graphics.axis.decorator.BoxFrame method
get is a built-in method % Shadowed matlab.graphics.axis.dataspace.CartesianDataSpace method
get is a built-in method % Shadowed matlab.graphics.axis.colorspace.ColorSpace method
get is a built-in method % Shadowed matlab.graphics.axis.dataspace.DataSpace method
get is a built-in method % Shadowed matlab.graphics.axis.decorator.DecorationContainer method
get is a built-in method % Shadowed matlab.graphics.axis.colorspace.MapColorSpace method
get is a built-in method % Shadowed matlab.graphics.axis.decorator.NumericRuler method
get is a built-in method % Shadowed matlab.graphics.axis.PlotTarget method
get is a built-in method % Shadowed matlab.graphics.axis.PlotTargetManager method
get is a built-in method % Shadowed matlab.graphics.axis.decorator.Ruler method
get is a built-in method % Shadowed matlab.graphics.axis.decorator.SelectionHighlight method
get is a built-in method % Shadowed matlab.graphics.axis.camera.Camera method
get is a built-in method % Shadowed matlab.graphics.axis.camera.Camera3D method
get is a built-in method % Shadowed matlab.graphics.primitive.Image method
get is a built-in method % Shadowed matlab.graphics.primitive.Text method
get is a built-in method % Shadowed matlab.graphics.mixin.AbstractAxesParentable method
get is a built-in method % Shadowed matlab.graphics.mixin.AxesParentable method
get is a built-in method % Shadowed matlab.graphics.mixin.Background method
get is a built-in method % Shadowed matlab.graphics.mixin.HintConsumer method
get is a built-in method % Shadowed matlab.graphics.mixin.LegendTarget method
get is a built-in method % Shadowed matlab.graphics.mixin.SceneNodeGroup method
get is a built-in method % Shadowed matlab.graphics.mixin.UIAxesParentable method
get is a built-in method % Shadowed matlab.graphics.mixin.UIParentable method
get is a built-in method % Shadowed matlab.graphics.primitive.world.ClipNode method
get is a built-in method % Shadowed matlab.graphics.primitive.world.Geometry method
get is a built-in method % Shadowed matlab.graphics.primitive.world.LightSource method
get is a built-in method % Shadowed matlab.graphics.primitive.world.LineStrip method
get is a built-in method % Shadowed matlab.graphics.primitive.world.CompositeMarker method
get is a built-in method % Shadowed matlab.graphics.primitive.world.PrimitiveBase method
get is a built-in method % Shadowed matlab.graphics.primitive.world.Quadrilateral method
get is a built-in method % Shadowed matlab.graphics.primitive.world.Text method
get is a built-in method % Shadowed matlab.graphics.primitive.Data method
get is a built-in method % Shadowed matlab.graphics.primitive.world.Group method
get is a built-in method % Shadowed matlab.graphics.primitive.world.SceneNode method
get is a built-in method % Shadowed matlab.graphics.primitive.canvas.CanvasFactory method
get is a built-in method % Shadowed matlab.graphics.primitive.canvas.Canvas method
get is a built-in method % Shadowed matlab.graphics.primitive.canvas.HTMLCanvas method
get is a built-in method % Shadowed matlab.graphics.primitive.canvas.HTMLCanvasFactory method
C:\Program Files\MATLAB\R2018b\toolbox\shared\reqmgt\+rmimap\@StorageMapper\StorageMapper.p % Shadowed rmimap.StorageMapper method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\codetools\embeddedoutputs\+matlab\+internal\+editor\+figure\Registrator.p % Shadowed matlab.internal.editor.figure.Registrator method
get is a built-in method % Shadowed matlab.graphics.internal.LiveEditorCodeGenBehavior method
get is a built-in method % Shadowed matlab.graphics.internal.HGBehavior method
get is a Java method % Shadowed com.mathworks.product.util.ProductIdentifier method
get is a built-in method % Shadowed javahandle.com.mathworks.hg.peer.ToolbarPeer method
get is a built-in method % Shadowed javahandle.com.mathworks.hg.peer.ToolPushButtonPeer method
get is a built-in method % Shadowed javahandle.com.mathworks.hg.peer.ToolToggleButtonPeer method
get is a built-in method % Shadowed javahandle.com.mathworks.hg.peer.MenuPeer method
C:\Users\sterg\Box\Johnson\Sterling & Tyler - Diffusivity\Matlab Code\polylx\@cipdata\get.m % Shadowed cipdata method
C:\Users\sterg\Box\Johnson\Sterling & Tyler - Diffusivity\Matlab Code\polylx\@polylxboundary\get.m % Shadowed polylxboundary method
C:\Users\sterg\Box\Johnson\Sterling & Tyler - Diffusivity\Matlab Code\polylx\@polylxgrain\get.m % Shadowed polylxgrain method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\randfun\@RandStream\get.m % Shadowed RandStream method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\graph2d\@arrowline\get.m % Shadowed arrowline method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\graph2d\@axischild\get.m % Shadowed axischild method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\graph2d\@axisobj\get.m % Shadowed axisobj method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\graph2d\@axistext\get.m % Shadowed axistext method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\graph2d\@figobj\get.m % Shadowed figobj method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\graph2d\@hgbin\get.m % Shadowed hgbin method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\graph2d\@scribehandle\get.m % Shadowed scribehandle method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\graph2d\@scribehgobj\get.m % Shadowed scribehgobj method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\winfun\@COM\get.m % Shadowed COM method
C:\Program Files\MATLAB\R2018b\toolbox\simulink\simulink\frameedit\@cellline\get.m % Shadowed cellline method
C:\Program Files\MATLAB\R2018b\toolbox\simulink\simulink\frameedit\@celltext\get.m % Shadowed celltext method
C:\Program Files\MATLAB\R2018b\toolbox\simulink\simulink\frameedit\@framerect\get.m % Shadowed framerect method
C:\Program Files\MATLAB\R2018b\toolbox\instrument\instrument\@icdevice\get.m % Shadowed icdevice method
C:\Program Files\MATLAB\R2018b\toolbox\instrument\instrument\@icgroup\get.m % Shadowed icgroup method
C:\Program Files\MATLAB\R2018b\toolbox\instrument\instrument\@iviconfigurationstore\get.m % Shadowed iviconfigurationstore method
C:\Program Files\MATLAB\R2018b\toolbox\shared\instrument\@instrument\get.m % Shadowed instrument method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\serial\@serial\get.m % Shadowed serial method
C:\Program Files\MATLAB\R2018b\toolbox\shared\controllib\engine\@InputOutputModel\get.m % Shadowed InputOutputModel method
C:\Program Files\MATLAB\R2018b\toolbox\shared\slcontrollib\@opcond\get.m % Shadowed opcond method
C:\Program Files\MATLAB\R2018b\toolbox\shared\statslib\@dataset\get.m % Shadowed dataset method
C:\Program Files\MATLAB\R2018b\toolbox\signal\sptoolgui\@fdax\get.m % Shadowed fdax method
C:\Program Files\MATLAB\R2018b\toolbox\signal\sptoolgui\@fdline\get.m % Shadowed fdline method
C:\Program Files\MATLAB\R2018b\toolbox\signal\sptoolgui\@fdmeas\get.m % Shadowed fdmeas method
C:\Program Files\MATLAB\R2018b\toolbox\signal\sptoolgui\@fdspec\get.m % Shadowed fdspec method
C:\Program Files\MATLAB\R2018b\toolbox\sl3d\sl3d\@vrfigure\get.m % Shadowed vrfigure method
C:\Program Files\MATLAB\R2018b\toolbox\sl3d\sl3d\@vrnode\get.m % Shadowed vrnode method
C:\Program Files\MATLAB\R2018b\toolbox\sl3d\sl3d\@vrworld\get.m % Shadowed vrworld method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\timeseries\@timeseries\get.m % Shadowed timeseries method
C:\Program Files\MATLAB\R2018b\toolbox\matlab\timeseries\@tscollection\get.m % Shadowed tscollection method
It turns out because mtex has something called isgraphics.m and it was an accessible folder, that seemed to be causing the issue. Thanks!

댓글을 달려면 로그인하십시오.

카테고리

제품

릴리스

R2016a

질문:

2018년 9월 19일

댓글:

2018년 11월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by