Sudden error "Conversion to double from struct is not possible"
7 次查看(过去 30 天)
显示 更早的评论
The error message occurred suddenly after many successful runs of a script and without altering the line nor any near it. tried in command window and the result was the same. The line appears to be a precise replica of the example line in Matlab help.
>> set(gcf,'WindowState','maximized')
Error using set
Conversion to double from struct is not possible.
The Products box below will not allow me to enter MATLAB
The tags box below will not allow me to enter anything!
采纳的回答
Walter Roberson
2020-12-5
You might have assigned a value to a variable named gcf
Or possibly you introduced a new function named gcf
which gcf
10 个评论
David Slater
2020-12-6
Walter,
Many thanks. In an abortive attempt to add a title or name to a figure, I did give gcf a name, but I have tried this morning to delete it using delete(gcf), delete(gcf.name) clear(gcf) and clear(gcf.name). All of these result in error messages: the first two result in "Name must be a text scalar"; the second two result in "Reference to non-existent field 'name'". How can I get rid of this assignment?
I will raise my difficulty in adding a title to a whole figure, rather than one or more axes within it, as a separate question, unless you can conveniently cover it under this one.
Any thoughts on what was going wrong with the Add a Question form not allowing Matlab as a product and figure or gcf as key words?
David.
David Slater
2020-12-6
Thanks, Walter.
clear gcf works OK, and gcf disappears from the workspace, but running the script results in the same error message,
"Error using set
"Conversion to double from struct is not possible.
"Error in DraftThesis (line 765)
set(gcf,'WindowState','maximized')"
I use the command
"set(gcf,'WindowState','maximized')" without the double quotes
several times in the sript, and now the error message appears once each time I run the script, referring to line number of a different occurrence each time. As I mentioned earlier, I had run the script several times a day for several months since I included these commands without any error message.
The script is quite big, about 1000 lines including comments, but I would happily send it to you if that would help.
David.
Steven Lord
2020-12-6
Set an error breakpoint and run your code. When MATLAB stops at the debug prompt (K>>) run the following commands and show us what they display. This will check if you've accidentally created a variable or local function that's taking precedence over the built-in functions by these names.
which -all set
which -all gcf
David Slater
2020-12-6
Steven,
Thanks indeed for your response and for your collective perseverence.
I have implemented your suggestions and the result is as follows. I have copied the entire command window, but the first few lines may not be relevant.
It looks as though I have created a variable called gcf and failed to delete it. The variables list in the workspace shows it as a structure variable. It looks a sthough the problem would be solved if I could get rid of it.
David.
>> DraftThesis
File =
'DraftThesis'
ActReq =
6×7 table
Frequency_Name Frequency Linear_Velocity Volume_Velocity Displacement Pressure Cochlear_Impedance
__________________ _________ _______________ _______________ ____________ ________ __________________
"Min frequency" 98 0.367 1.77 0.6 125 71
"Max velocity" 551 1.296 6.24 0.37 633 101
"Max displacement" 98 0.367 1.77 0.6 125 71
"Max pressure" 328 0.719 3.46 0.35 1470 424
"Max impedance" 328 0.719 3.46 0.35 1470 424
"Max frequency" 1026 0.882 4.25 0.14 302 71
Error using set
Conversion to double from struct is not possible.
Error in DraftThesis (line 484)
set(gcf,'WindowState','maximized')
>> which -all set
built-in (C:\Program Files\MATLAB\R2020b\toolbox\matlab\graphics\objectsystem\set)
set is a Java method % com.mathworks.mde.editor.breakpoints.MatlabBreakpoint method
set is a Java method % com.mathworks.mlservices.debug.breakpoint.PositionalBreakpoint method
set is a Java method % com.mathworks.mlservices.debug.breakpoint.BreakpointBase method
set is a Java method % java.util.ArrayList method
set is a Java method % java.util.AbstractList method
set is a Java method % java.util.List method
set is a built-in method % matlab.ui.internal.mixin.Printable method
set is a built-in method % matlab.ui.internal.mixin.Windowable method
set is a built-in method % matlab.ui.Figure method
set is a built-in method % matlab.ui.internal.mixin.AutoResizable method
set is a built-in method % matlab.ui.internal.mixin.AxesLimits method
set is a built-in method % matlab.ui.internal.mixin.Legacy method
set is a built-in method % matlab.ui.internal.mixin.FontRenderable method
set is a built-in method % matlab.ui.internal.mixin.KeyInvokable method
set is a built-in method % matlab.ui.internal.mixin.NoMarginsUnitsOnlyPositionable method
set is a built-in method % matlab.ui.internal.mixin.Positionable method
set is a built-in method % matlab.ui.internal.mixin.Selectable method
set is a built-in method % matlab.ui.internal.mixin.Scrollable method
set is a built-in method % matlab.ui.internal.mixin.CanvasHostMixin method
set is a built-in method % matlab.ui.internal.mixin.TerminalStateRepresentable method
set is a built-in method % matlab.ui.Root method
set is a built-in method % matlab.ui.control.ClientComponent method
set is a built-in method % matlab.ui.control.Component method
set is a built-in method % matlab.ui.container.Container method
set is a built-in method % matlab.ui.container.CanvasContainer method
set is a built-in method % matlab.ui.control.WebComponent method
set is a built-in method % matlab.ui.control.UIControl method
set is a built-in method % matlab.ui.container.ContextMenu method
set is a built-in method % matlab.ui.container.Menu method
set is a built-in method % matlab.ui.container.toolbar.PushTool method
set is a built-in method % matlab.ui.container.toolbar.ToggleTool method
set is a built-in method % matlab.ui.internal.mixin.UIToggleToolMixin method
set is a built-in method % matlab.ui.internal.mixin.UIToolMixin method
set is a built-in method % matlab.ui.container.Toolbar method
set is a built-in method % matlab.ui.internal.UnitsService method
set is a built-in method % matlab.ui.internal.UnitsServiceStorageInterface method
set is a built-in method % matlab.ui.internal.UnitsServiceStorage method
set is a built-in method % matlab.graphics.internal.GraphicsUIProperties method
set is a built-in method % matlab.graphics.internal.GraphicsCoreProperties method
set is a built-in method % matlab.graphics.mixin.GraphicsPickable method
set is a built-in method % matlab.graphics.mixin.Layoutable method
set is a built-in method % matlab.graphics.internal.Legacy method
set is a built-in method % matlab.graphics.mixin.Mixin method
set is a built-in method % matlab.graphics.mixin.NodeParent method
set is a built-in method % matlab.graphics.mixin.NodeChildren method
set is a built-in method % matlab.graphics.mixin.Pickable method
set is a built-in method % matlab.graphics.mixin.Selectable method
set is a built-in method % matlab.graphics.internal.GraphicsBaseFunctions method
set is a built-in method % matlab.graphics.Graphics method
set is a built-in method % matlab.graphics.GraphicsPlaceholder method
set is a built-in method % matlab.graphics.internal.GraphicsPropertyHandler method
set is a built-in method % matlab.graphics.internal.ReferenceObject method
set is a built-in method % matlab.mixin.SetGet method
set is a built-in method % hgsetget method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\randfun\@RandStream\set.m % RandStream method
set is a built-in method % schema.package method
set is a built-in method % schema.class method
set is a built-in method % handle.handle method
set is a built-in method % ReqMgr.LinkType method
set is a built-in method % schema.prop method
set is a built-in method % handle.subreference__ method
C:\Program Files\MATLAB\R2020b\toolbox\shared\reqmgt\+rmimap\@StorageMapper\StorageMapper.p % rmimap.StorageMapper method
set is a built-in method % matlab.graphics.axis.Axes method
set is a Java method % java.util.Collections$SingletonList method
set is a Java method % java.util.Collections$UnmodifiableRandomAccessList method
set is a Java method % java.util.Collections$UnmodifiableList method
set is a built-in method % javahandle.com.mathworks.hg.peer.HG2FigurePeer method
set is a built-in method % matlab.graphics.mixin.Chartable method
set is a built-in method % matlab.graphics.chart.interaction.DataAnnotatable method
set is a built-in method % matlab.graphics.chart.primitive.Line method
set is a built-in method % matlab.graphics.axis.AbstractAxes method
set is a built-in method % matlab.graphics.axis.decorator.AxisDecoration method
set is a built-in method % matlab.graphics.axis.decorator.AxisRulerBase method
set is a built-in method % matlab.graphics.axis.decorator.Backdrop method
set is a built-in method % matlab.graphics.axis.decorator.BoxFrame method
set is a built-in method % matlab.graphics.axis.dataspace.CartesianDataSpace method
set is a built-in method % matlab.graphics.axis.colorspace.ColorSpace method
set is a built-in method % matlab.graphics.axis.dataspace.DataSpace method
set is a built-in method % matlab.graphics.axis.decorator.DecorationContainer method
set is a built-in method % matlab.graphics.axis.decorator.Grid method
set is a built-in method % matlab.graphics.axis.HintConsumer method
set is a built-in method % matlab.graphics.axis.colorspace.MapColorSpace method
set is a built-in method % matlab.graphics.axis.decorator.NumericRuler method
set is a built-in method % matlab.graphics.axis.PlotTarget method
set is a built-in method % matlab.graphics.axis.PlotTargetManager method
set is a built-in method % matlab.graphics.axis.decorator.Ruler method
set is a built-in method % matlab.graphics.axis.decorator.ScalableAxisRuler method
set is a built-in method % matlab.graphics.axis.decorator.SelectionHighlight method
set is a built-in method % matlab.graphics.axis.decorator.SimpleGrid method
set is a built-in method % matlab.graphics.axis.dataspace.UniformCartesianDataSpace method
set is a built-in method % matlab.graphics.axis.camera.Camera method
set is a built-in method % matlab.graphics.axis.camera.Camera2D method
set is a built-in method % matlab.graphics.axis.camera.Camera3D method
set is a built-in method % matlab.graphics.primitive.Text method
set is a built-in method % matlab.graphics.interactor.ListOfPointsHighlight method
set is a built-in method % matlab.graphics.mixin.AbstractAxesParentable method
set is a built-in method % matlab.graphics.mixin.AxesParentable method
set is a built-in method % matlab.graphics.mixin.Background method
set is a built-in method % matlab.graphics.mixin.ChartLayoutable method
set is a built-in method % matlab.graphics.mixin.LegendTarget method
set is a built-in method % matlab.graphics.mixin.Legendable method
set is a built-in method % matlab.graphics.mixin.ColorOrderUser method
set is a built-in method % matlab.graphics.mixin.PolarAxesParentable method
set is a built-in method % matlab.graphics.mixin.GeographicAxesParentable method
set is a built-in method % matlab.graphics.mixin.SceneNodeGroup method
set is a built-in method % matlab.graphics.mixin.UIAxesParentable method
set is a built-in method % matlab.graphics.mixin.UIParentable method
set is a built-in method % matlab.graphics.primitive.world.ClipNode method
set is a built-in method % matlab.graphics.primitive.world.Geometry method
set is a built-in method % matlab.graphics.primitive.world.LightSource method
set is a built-in method % matlab.graphics.primitive.world.LineLoop method
set is a built-in method % matlab.graphics.primitive.world.LineStrip method
set is a built-in method % matlab.graphics.primitive.world.Marker method
set is a built-in method % matlab.graphics.primitive.world.CompositeMarker method
set is a built-in method % matlab.graphics.primitive.world.PrimitiveBase method
set is a built-in method % matlab.graphics.primitive.world.Quadrilateral method
set is a built-in method % matlab.graphics.primitive.world.Text method
set is a built-in method % matlab.graphics.primitive.world.TriangleStrip method
set is a built-in method % matlab.graphics.eventdata.Annotation method
set is a built-in method % matlab.graphics.eventdata.LegendEntry method
set is a built-in method % matlab.graphics.primitive.Data method
set is a built-in method % matlab.graphics.primitive.world.Group method
set is a built-in method % matlab.graphics.primitive.Group method
set is a built-in method % matlab.graphics.primitive.Transform method
set is a built-in method % matlab.graphics.primitive.world.SceneNode method
set is a built-in method % matlab.graphics.primitive.canvas.Canvas method
set is a built-in method % matlab.graphics.primitive.canvas.CanvasFactory method
set is a built-in method % matlab.graphics.primitive.canvas.JavaCanvasFactory method
set is a built-in method % matlab.graphics.primitive.canvas.JavaCanvas method
set is a built-in method % matlab.graphics.shape.internal.ScribeStackManager method
set is a built-in method % matlab.graphics.shape.internal.ScribeLayer method
set is a built-in method % matlab.graphics.shape.internal.AnnotationPane method
set is a built-in method % javahandle.com.mathworks.hg.peer.ToolbarPeer method
set is a built-in method % javahandle.com.mathworks.hg.peer.ToolPushButtonPeer method
set is a built-in method % javahandle.com.mathworks.hg.peer.ToolToggleButtonPeer method
set is a built-in method % javahandle.com.mathworks.hg.peer.MenuPeer method
set is a built-in method % matlab.graphics.shape.internal.Button method
set is a built-in method % matlab.graphics.internal.DataCursorBehavior method
set is a built-in method % matlab.graphics.internal.HGBehavior method
set is a built-in method % matlab.graphics.shape.internal.ButtonImage method
set is a built-in method % matlab.ui.controls.ToolbarPushButton method
set is a built-in method % matlab.graphics.controls.AxesToolbarButton method
set is a built-in method % matlab.ui.controls.ToolbarStateButton method
set is a built-in method % COM.Excel_Application method
set is a built-in method % schema.method method
set is a built-in method % schema.event method
set is a built-in method % handle.listener method
set is a built-in method % Interface.000208DB_0000_0000_C000_000000000046 method
set is a built-in method % Excel_Application0.WorkbookActivateData method
set is a built-in method % handle.EventData method
set is a built-in method % Interface.000208DA_0000_0000_C000_000000000046 method
set is a built-in method % Interface.000208D7_0000_0000_C000_000000000046 method
set is a built-in method % Interface.000208D8_0000_0000_C000_000000000046 method
set is a built-in method % Interface.00020846_0000_0000_C000_000000000046 method
set is a built-in method % matlab.graphics.illustration.Legend method
set is a built-in method % matlab.graphics.illustration.legend.Text method
set is a built-in method % matlab.graphics.internal.PlotEditBehavior method
set is a built-in method % matlab.graphics.internal.PrintBehavior method
set is a built-in method % matlab.graphics.shape.internal.AxesLayoutManager method
set is a built-in method % matlab.graphics.illustration.legend.LegendEntry method
set is a built-in method % matlab.graphics.illustration.legend.LegendIcon method
set is a built-in method % matlab.graphics.internal.mlprintjob method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@arrowline\set.m % arrowline method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@axischild\set.m % axischild method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@axisobj\set.m % axisobj method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@axistext\set.m % axistext method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@editline\set.m % editline method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@editrect\set.m % editrect method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@figobj\set.m % figobj method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@scribehandle\set.m % scribehandle method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\graph2d\@scribehgobj\set.m % scribehgobj method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\winfun\@COM\set.m % COM method
C:\Program Files\MATLAB\R2020b\toolbox\simulink\ui\printing\@cellline\set.m % cellline method
C:\Program Files\MATLAB\R2020b\toolbox\simulink\ui\printing\@celltext\set.m % celltext method
C:\Program Files\MATLAB\R2020b\toolbox\simulink\ui\printing\@framerect\set.m % framerect method
C:\Program Files\MATLAB\R2020b\toolbox\bioinfo\bioinfo\@BioSeq\set.m % BioSeq method
C:\Program Files\MATLAB\R2020b\toolbox\bioinfo\bioinfo\@phytree\set.m % phytree method
C:\Program Files\MATLAB\R2020b\toolbox\ident\ident\@iddata\set.m % iddata method
C:\Program Files\MATLAB\R2020b\toolbox\ident\nlident\@customreg\set.m % customreg method
C:\Program Files\MATLAB\R2020b\toolbox\ident\nlident\@idnlfun\set.m % idnlfun method
C:\Program Files\MATLAB\R2020b\toolbox\ident\nlident\@idnlmodel\set.m % idnlmodel method
C:\Program Files\MATLAB\R2020b\toolbox\imaq\imaq\@imaqchild\set.m % imaqchild method
C:\Program Files\MATLAB\R2020b\toolbox\imaq\imaq\@imaqdevice\set.m % imaqdevice method
C:\Program Files\MATLAB\R2020b\toolbox\instrument\instrument\@icdevice\set.m % icdevice method
C:\Program Files\MATLAB\R2020b\toolbox\instrument\instrument\@icgroup\set.m % icgroup method
C:\Program Files\MATLAB\R2020b\toolbox\instrument\instrument\@iviconfigurationstore\set.m % iviconfigurationstore method
C:\Program Files\MATLAB\R2020b\toolbox\shared\instrument\@instrument\set.m % instrument method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgcalinput\set.m % cgcalinput method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgoppoint\set.m % cgoppoint method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgoptim\set.m % cgoptim method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgprec\set.m % cgprec method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgprecfix\set.m % cgprecfix method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgprecfloat\set.m % cgprecfloat method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgpreclookupfix\set.m % cgpreclookupfix method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgprecpolyfix\set.m % cgprecpolyfix method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdata\@cgrules\set.m % cgrules method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@csetinterface\set.m % csetinterface method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_boxb\set.m % cset_boxb method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_ccd\set.m % cset_ccd method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_fullfact\set.m % cset_fullfact method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_grdlatt\set.m % cset_grdlatt method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_grid\set.m % cset_grid method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_haltonset\set.m % cset_haltonset method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_lattice\set.m % cset_lattice method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_lhs\set.m % cset_lhs method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_pb\set.m % cset_pb method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_pointset\set.m % cset_pointset method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_simplex\set.m % cset_simplex method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_sobolset\set.m % cset_sobolset method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_stratlattice\set.m % cset_stratlattice method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcdesign\@cset_userdef\set.m % cset_userdef method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgclipexpr\set.m % cgclipexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgconstant\set.m % cgconstant method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgdivexpr\set.m % cgdivexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgfeature\set.m % cgfeature method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgfuncexpr\set.m % cgfuncexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgifexpr\set.m % cgifexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cglookupone\set.m % cglookupone method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cglookuptwo\set.m % cglookuptwo method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgminmaxexpr\set.m % cgminmaxexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgmodexpr\set.m % cgmodexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgmswitchexpr\set.m % cgmswitchexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgnormaliser\set.m % cgnormaliser method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgnormfunction\set.m % cgnormfunction method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgrelexpr\set.m % cgrelexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgsubexpr\set.m % cgsubexpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgsymvalue\set.m % cgsymvalue method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgvalue\set.m % cgvalue method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcexpr\@cgvariable\set.m % cgvariable method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@axestext\set.m % axestext method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@listitemselector\set.m % listitemselector method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@mvgraph1d\set.m % mvgraph1d method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@mvgraph2d\set.m % mvgraph2d method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@mvgraph3d\set.m % mvgraph3d method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@mvgraph4d\set.m % mvgraph4d method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@seltext\set.m % seltext method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@texlistbox\set.m % texlistbox method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xregaxesinput\set.m % xregaxesinput method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xregclickinput\set.m % xregclickinput method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xregclicktolinput\set.m % xregclicktolinput method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xregcolorbar\set.m % xregcolorbar method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xreglegend\set.m % xreglegend method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xreglistctrl\set.m % xreglistctrl method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xregmultigraph2d\set.m % xregmultigraph2d method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xregrangeinput\set.m % xregrangeinput method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xregtable\set.m % xregtable method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcguitools\@xregvectorinput\set.m % xregvectorinput method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregborderlayout\set.m % xregborderlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregcardlayout\set.m % xregcardlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregcontainer\set.m % xregcontainer method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregcurtainfxlayout\set.m % xregcurtainfxlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregflowlayout\set.m % xregflowlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xreggridlayout\set.m % xreggridlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xreglayerlayout\set.m % xreglayerlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregslidefxlayout\set.m % xregslidefxlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregsnapsplitlayout\set.m % xregsnapsplitlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregsplitlayout\set.m % xregsplitlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbclayouts\@xregtoolbarlayout\set.m % xregtoolbarlayout method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localavfit\set.m % localavfit method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localbspline\set.m % localbspline method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localmod\set.m % localmod method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localmulti\set.m % localmulti method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localpoly\set.m % localpoly method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localpspline\set.m % localpspline method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localsurface\set.m % localsurface method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localtruncps\set.m % localtruncps method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@localusermod\set.m % localusermod method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@term_selector\set.m % term_selector method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xreg3xspline\set.m % xreg3xspline method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregcubic\set.m % xregcubic method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregexportmodel\set.m % xregexportmodel method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xreggpr\set.m % xreggpr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xreghybridrbf\set.m % xreghybridrbf method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xreginterprbf\set.m % xreginterprbf method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xreglinear\set.m % xreglinear method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregmodel\set.m % xregmodel method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregmulti\set.m % xregmulti method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregnnet\set.m % xregnnet method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregoptmgr\set.m % xregoptmgr method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregrbf\set.m % xregrbf method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregtransient\set.m % xregtransient method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregtwostage\set.m % xregtwostage method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcmodels\@xregunispline\set.m % xregunispline method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbctools\@sweepset\set.m % sweepset method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbctools\@sweepsetfilter\set.m % sweepsetfilter method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbctools\@testplansweepsetfilter\set.m % testplansweepsetfilter method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcview\@cgnormnode\set.m % cgnormnode method
C:\Program Files\MATLAB\R2020b\toolbox\mbc\mbcview\@cgtablenode\set.m % cgtablenode method
C:\Program Files\MATLAB\R2020b\toolbox\mpc\mpc\@mpc\set.m % mpc method
C:\Program Files\MATLAB\R2020b\toolbox\mpc\mpc\@mpcmoveopt\set.m % mpcmoveopt method
C:\Program Files\MATLAB\R2020b\toolbox\mpc\mpc\@mpcsimopt\set.m % mpcsimopt method
C:\Program Files\MATLAB\R2020b\toolbox\mpc\mpc\@mpcstate\set.m % mpcstate method
C:\Program Files\MATLAB\R2020b\toolbox\opc\opc\@opcroot\set.m % opcroot method
C:\Program Files\MATLAB\R2020b\toolbox\robust\rctobsolete\robust\@gsref\set.m % gsref method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\serial\@serial\set.m % serial method
C:\Program Files\MATLAB\R2020b\toolbox\shared\controllib\engine\@DynamicSystem\set.m % DynamicSystem method
C:\Program Files\MATLAB\R2020b\toolbox\shared\controllib\engine\@InputOutputModel\set.m % InputOutputModel method
C:\Program Files\MATLAB\R2020b\toolbox\shared\slcontrollib\@opcond\set.m % opcond method
C:\Program Files\MATLAB\R2020b\toolbox\shared\statslib\@dataset\set.m % dataset method
C:\Program Files\MATLAB\R2020b\toolbox\signal\sptoolgui\@fdax\set.m % fdax method
C:\Program Files\MATLAB\R2020b\toolbox\signal\sptoolgui\@fdline\set.m % fdline method
C:\Program Files\MATLAB\R2020b\toolbox\signal\sptoolgui\@fdmeas\set.m % fdmeas method
C:\Program Files\MATLAB\R2020b\toolbox\signal\sptoolgui\@fdspec\set.m % fdspec method
C:\Program Files\MATLAB\R2020b\toolbox\sl3d\sl3d\@vrfigure\set.m % vrfigure method
C:\Program Files\MATLAB\R2020b\toolbox\sl3d\sl3d\@vrnode\set.m % vrnode method
C:\Program Files\MATLAB\R2020b\toolbox\sl3d\sl3d\@vrworld\set.m % vrworld method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\timeseries\@timeseries\set.m % timeseries method
C:\Program Files\MATLAB\R2020b\toolbox\matlab\timeseries\@tscollection\set.m % tscollection method
C:\Program Files\MATLAB\R2020b\toolbox\wavelet\wavelet\@dtree\set.m % dtree method
C:\Program Files\MATLAB\R2020b\toolbox\wavelet\wavelet\@ntree\set.m % ntree method
C:\Program Files\MATLAB\R2020b\toolbox\wavelet\wavelet\@wptree\set.m % wptree method
C:\Program Files\MATLAB\R2020b\toolbox\wavelet\wavelet\@wtbo\set.m % wtbo method
C:\Program Files\MATLAB\R2020b\toolbox\wavelet\wmultisig1d\@wpartobj\set.m % wpartobj method
>> which -all gcf
gcf is a variable.
built-in (C:\Program Files\MATLAB\R2020b\toolbox\matlab\graphics\gcf) % Shadowed
>>
David Slater
2020-12-6
Thanks, Walter.
How can I unassign to gcf and avoid re-assigning to it, so that the error no longer occurs?
David.
Walter Roberson
2020-12-6
clear gcf
will remove any current assignment to a variable named gcf
You will have to search your code or put in debugging statements to figure out how gcf is being assigned to.
David Slater
2020-12-6
Thank you indeed, Walter. The problem is now solved. In my earlier efforts to add a title to a figure, I had changed
set(gcf,'WindowState','maximized')
to
gcf.WindowState='maximized';
and I had failed to realize that I hadn't changed it back. This had the effect of assigning a value to gcf each time a ran the script and turning it into a variable.This cancelled the result of
clear gcf
Changing the line in the script back to a set command has cured the problem. I will now gratefully accept your answer.
Thanks again.
David.
Walter Roberson
2020-12-6
Ah yes, that could do it.
Unfortunately gcf and gca are functions . Although with a relatively recent change to MATLAB it is possible to hack to be able to access properties of the object returned, you cannot assign to it:
>> struct('T', gcf).T.WindowState
ans =
'normal'
I do not recommend this hack.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)