can't print pictures
1 次查看(过去 30 天)
显示 更早的评论
Use the function "print" to print a picture, sometimes it can work it out, but most time it failed. The reason is wrong with matlab.graphics.internal.name. I don't know what it means,can anyone help me?
6 个评论
Stephen23
2020-2-15
yiping LIU's "Answer" moved here:
thanks for your attention.
here is my code: print(gcf,'-dtiff','-r600','w5.tif');
the following picture are the full error messages:
Subhadeep Koley
2020-2-15
@ yiping LIU Probably you have a custom delete.m or print.m that is interfering with the MATLAB built-in functions. Can you provide what you see after you execute the below commands?
which -all print
which -all delete
Also you can try to restore default MATLAB path using
restoredefaultpath
But, be carefull restoredefaultpath can remove any useful paths that you have added manually.
Stephen23
2020-2-15
yiping LIU's "Answer" moved here:
here are what I see:
which -all print
E:\matlab\toolbox\matlab\graphics\printing\print.m
print is a Java method % java.io.PrintStream method
E:\matlab\toolbox\mbc\mbctools\@mdev_local\print.m % mdev_local method
E:\matlab\toolbox\mbc\mbctools\@modeldev\print.m % modeldev method
which -all delete
C:\Users\panchaopang\Documents\MATLAB\delete.m
built-in (E:\matlab\toolbox\matlab\general\@double\delete) % double method
delete is a built-in method % meta.PackageList method
delete is a built-in method % handle method
delete is a built-in method % meta.ClassList method
delete is a built-in method % meta.FunctionList method
delete is a built-in method % meta.TypeList method
delete is a built-in method % matlab.internal.language.ir_workspace_ownership_proxy method
C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@S1Grid\delete.m % S1Grid method
C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@S2Grid\delete.m % S2Grid method
C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@SO3Grid\delete.m % SO3Grid method
delete is a built-in method % inputParser method
E:\matlab\toolbox\matlab\general\onCleanup.m % onCleanup method
delete is a built-in method % matlab.ui.internal.mixin.Printable method
delete is a built-in method % matlab.ui.internal.mixin.Windowable method
delete is a built-in method % matlab.ui.Figure method
delete is a built-in method % matlab.ui.internal.mixin.AutoResizable method
delete is a built-in method % matlab.ui.internal.mixin.AxesLimits method
delete is a built-in method % matlab.ui.internal.mixin.Legacy method
delete is a built-in method % matlab.ui.internal.mixin.KeyInvokable method
delete is a built-in method % matlab.ui.internal.mixin.Positionable method
delete is a built-in method % matlab.ui.internal.mixin.Scrollable method
delete is a built-in method % matlab.ui.internal.mixin.Selectable method
delete is a built-in method % matlab.ui.internal.mixin.TerminalStateRepresentable method
delete is a built-in method % matlab.ui.Root method
delete is a built-in method % matlab.ui.control.Component method
delete is a built-in method % matlab.ui.container.Container method
delete is a built-in method % matlab.ui.container.CanvasContainer method
delete is a built-in method % matlab.ui.control.WebComponent method
delete is a built-in method % matlab.graphics.Graphics method
delete is a built-in method % matlab.graphics.GraphicsPlaceholder method
delete is a built-in method % matlab.graphics.mixin.internal.Copyable method
delete is a built-in method % matlab.graphics.internal.GraphicsPropertyHandler method
delete is a built-in method % matlab.graphics.internal.ReferenceObject method
delete is a built-in method % matlab.graphics.internal.GraphicsMetaProperty method
delete is a built-in method % matlab.graphics.internal.GraphicsMetaClass method
delete is a built-in method % matlab.graphics.internal.GraphicsJavaVisible method
delete is a built-in method % matlab.graphics.mixin.GraphicsPickable method
delete is a built-in method % matlab.graphics.mixin.Mixin method
delete is a built-in method % matlab.graphics.mixin.NodeChildren method
delete is a built-in method % matlab.graphics.mixin.NodeParent method
delete is a built-in method % matlab.graphics.mixin.Selectable method
delete is a built-in method % matlab.graphics.internal.GraphicsBaseFunctions method
delete is a built-in method % matlab.graphics.internal.GraphicsUIProperties method
delete is a built-in method % matlab.graphics.internal.GraphicsCoreProperties method
delete is a built-in method % matlab.graphics.internal.Legacy method
delete is a built-in method % matlab.graphics.internal.Exportable method
delete is a built-in method % meta.class method
delete is a built-in method % meta.MetaData method
delete is a built-in method % matlab.mixin.SetGet method
delete is a built-in method % hgsetget method
delete is a built-in method % dynamicprops method
delete is a built-in method % meta.property method
delete is a built-in method % JavaVisible method
delete is a built-in method % matlab.mixin.internal.DefaultFactoryPropHandler method
delete is a built-in method % matlab.graphics.axis.AbstractAxes method
delete is a built-in method % matlab.graphics.axis.Axes method
delete is a built-in method % matlab.graphics.primitive.Line method
delete is a built-in method % matlab.graphics.mixin.AxesParentable method
delete is a built-in method % matlab.graphics.mixin.Background method
delete is a built-in method % matlab.graphics.mixin.ChartLayoutable method
delete is a built-in method % matlab.graphics.mixin.GeographicAxesParentable method
delete is a built-in method % matlab.graphics.mixin.HintConsumer method
delete is a built-in method % matlab.graphics.mixin.LegendTarget method
delete is a built-in method % matlab.graphics.mixin.Legendable method
delete is a built-in method % matlab.graphics.mixin.PolarAxesParentable method
delete is a built-in method % matlab.graphics.mixin.UIAxesParentable method
delete is a built-in method % matlab.graphics.mixin.UIParentable method
delete is a built-in method % matlab.graphics.primitive.Data method
delete is a built-in method % matlab.graphics.primitive.world.Group method
delete is a built-in method % matlab.graphics.primitive.world.SceneNode method
delete is a built-in method % matlab.graphics.illustration.Legend method
delete is a built-in method % event.listener method
delete is a built-in method % FileWrapper__ method
delete is a built-in method % matlab.internal.i18n.locale method
delete is a built-in method % meta.EnumeratedValue method
delete is a built-in method % matlab.internal.language.localized_anonymous_function_handle_workspace_ownership_proxy method
delete is a Java method % java.io.File method
delete is a built-in method % meta.package method
delete is a built-in method % matlab.unittest.internal.services.suitecreation.SuiteCreationLiaison method
delete is a built-in method % matlab.unittest.internal.services.namingconvention.NamingConventionLiaison method
delete is a built-in method % matlab.unittest.internal.NameParser method
delete is a built-in method % internal.deviceplugindetection.Manager method
E:\matlab\toolbox\shared\hotpluglib\+internal\+hotplug\EventSource.m % internal.hotplug.EventSource method
E:\matlab\toolbox\shared\asynciolib\+asyncio\Channel.m % asyncio.Channel method
delete is a built-in method % asyncio.MessageHandler method
delete is a built-in method % asyncioimpl.Channel method
delete is a built-in method % asyncioimpl.InputStream method
delete is a built-in method % asyncioimpl.OutputStream method
delete is a built-in method % asyncioimpl.MessageHandler method
E:\matlab\toolbox\shared\asynciolib\+asyncio\Stream.m % asyncio.InputStream method
delete is a built-in method % matlabshared.supportpkg.internal.SupportPackageRootHandler method
delete is a built-in method % matlabshared.supportpkg.internal.SettingWriterReader method
delete is a built-in method % matlabshared.supportpkg.internal.SingleRootHandler method
delete is a built-in method % connector.internal.Logger method
delete is a built-in method % meta.method method
delete is a built-in method % connector.internal.Future method
delete is a built-in method % connector.internal.Promise method
delete is a built-in method % matlab.mixin.Copyable method
E:\matlab\toolbox\matlab\iofun\@ftp\delete.m % ftp method
E:\matlab\toolbox\matlab\lang\@handle\delete.m % handle method
E:\matlab\toolbox\matlab\graph2d\@arrowline\delete.m % arrowline method
E:\matlab\toolbox\matlab\graph2d\@editrect\delete.m % editrect method
E:\matlab\toolbox\matlab\graph2d\@hgbin\delete.m % hgbin method
E:\matlab\toolbox\matlab\graph2d\@scribehandle\delete.m % scribehandle method
E:\matlab\toolbox\matlab\graph2d\@scribehgobj\delete.m % scribehgobj method
E:\matlab\toolbox\matlab\winfun\@COM\delete.m % COM method
E:\matlab\toolbox\imaq\imaq\@imaqchild\delete.m % imaqchild method
E:\matlab\toolbox\imaq\imaq\@imaqdevice\delete.m % imaqdevice method
E:\matlab\toolbox\shared\instrument\@instrument\delete.m % instrument method
E:\matlab\toolbox\mbc\mbc\@mctree\delete.m % mctree method
E:\matlab\toolbox\mbc\mbcdata\@cgprojconnections\delete.m % cgprojconnections method
E:\matlab\toolbox\mbc\mbcdesign\@des_constraints\delete.m % des_constraints method
E:\matlab\toolbox\mbc\mbcdesign\@xregdesign\delete.m % xregdesign method
E:\matlab\toolbox\mbc\mbcguitools\@axestext\delete.m % axestext method
E:\matlab\toolbox\mbc\mbcguitools\@listitemselector\delete.m % listitemselector method
E:\matlab\toolbox\mbc\mbcguitools\@mvgraph1d\delete.m % mvgraph1d method
E:\matlab\toolbox\mbc\mbcguitools\@mvgraph2d\delete.m % mvgraph2d method
E:\matlab\toolbox\mbc\mbcguitools\@mvgraph3d\delete.m % mvgraph3d method
E:\matlab\toolbox\mbc\mbcguitools\@mvgraph4d\delete.m % mvgraph4d method
E:\matlab\toolbox\mbc\mbcguitools\@seltext\delete.m % seltext method
E:\matlab\toolbox\mbc\mbcguitools\@texlistbox\delete.m % texlistbox method
E:\matlab\toolbox\mbc\mbcguitools\@xregaxesinput\delete.m % xregaxesinput method
E:\matlab\toolbox\mbc\mbcguitools\@xregclickinput\delete.m % xregclickinput method
E:\matlab\toolbox\mbc\mbcguitools\@xregclicktolinput\delete.m % xregclicktolinput method
E:\matlab\toolbox\mbc\mbcguitools\@xregcolorbar\delete.m % xregcolorbar method
E:\matlab\toolbox\mbc\mbcguitools\@xreglegend\delete.m % xreglegend method
E:\matlab\toolbox\mbc\mbcguitools\@xreglistctrl\delete.m % xreglistctrl method
E:\matlab\toolbox\mbc\mbcguitools\@xregmultigraph2d\delete.m % xregmultigraph2d method
E:\matlab\toolbox\mbc\mbcguitools\@xregrangeinput\delete.m % xregrangeinput method
E:\matlab\toolbox\mbc\mbcguitools\@xregtable\delete.m % xregtable method
E:\matlab\toolbox\mbc\mbcguitools\@xregvectorinput\delete.m % xregvectorinput method
E:\matlab\toolbox\mbc\mbclayouts\@xregcontainer\delete.m % xregcontainer method
E:\matlab\toolbox\mbc\mbctools\@xregbdrydev\delete.m % xregbdrydev method
E:\matlab\toolbox\mbc\mbcview\@cgproject\delete.m % cgproject method
E:\matlab\toolbox\opc\opc\@dagroup\delete.m % dagroup method
E:\matlab\toolbox\opc\opc\@daitem\delete.m % daitem method
E:\matlab\toolbox\opc\opc\@opcda\delete.m % opcda method
E:\matlab\toolbox\matlab\serial\@serial\delete.m % serial method
E:\matlab\toolbox\signal\sptoolgui\@fdax\delete.m % fdax method
E:\matlab\toolbox\signal\sptoolgui\@fdline\delete.m % fdline method
E:\matlab\toolbox\signal\sptoolgui\@fdmeas\delete.m % fdmeas method
E:\matlab\toolbox\signal\sptoolgui\@fdspec\delete.m % fdspec method
E:\matlab\toolbox\sl3d\sl3d\@vrnode\delete.m % vrnode method
E:\matlab\toolbox\sl3d\sl3d\@vrworld\delete.m % vrworld method
built-in (E:\matlab\toolbox\matlab\general\delete) % Shadowed
采纳的回答
Subhadeep Koley
2020-2-15
编辑:Subhadeep Koley
2020-2-15
It seems the paths below
"C:\Users\panchaopang\Documents\MATLAB\"
"C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@S1Grid\"
"C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@S2Grid\"
"C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@S03Grid\" in your computer has some custom delete.m which is interfering with the MATLAB built-in delete function.
There are two options
1. If possible rename those delete.m functions in those three paths.
2. Removing those paths from MATLAB's search path using the below command
rmpath('C:\Users\panchaopang\Documents\MATLAB\');
rmpath('C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@S1Grid\');
rmpath('C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@S2Grid\');
rmpath('C:\Users\panchaopang\Documents\mtex-5.2.5\mtex-5.2.5\geometry\@S03Grid\');
Hope this helps!
1 个评论
yiping LIU
2020-2-16
Sorry for replying late. I tried your first option and rename all the delete.m and the outcome is inspiring. Now I can use 'print' function normally. I'm really grateful for your help!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Search Path 的更多信息
标签
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 (한국어)