Print Error using printdlg (line 63)

조회 수: 6 (최근 30일)
Dustin Ho
Dustin Ho 2019년 8월 19일
답변: Dustin Ho 2019년 9월 3일
Hi,
I recently has a problem with print/copy a figure in MATLAB 2018b. I can not export or copy any figure in order to put into latex or word. The error shows up when I use "Copy Figure" in "Edit" menu in any figure:
Error using matlab.graphics.internal.copyFigureHelper (line 158)
The fourth input argument, FLAG, passed to MEX level2 S-function "print" must be an integer.
Error in editmenufcn (line 69)
matlab.graphics.internal.copyFigureHelper(hfig)
Error while evaluating Menu Callback.
And similarly, when I use the print option in "File" menu. Any idea why I get this problem. I highly appreciate for your help.
Error using printdlg (line 63)
MEX level2 S-function "print" must be called with at least 4 input arguments.
Error while evaluating PushTool ClickedCallback.
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 8월 19일
What shows up for
which -all print
You should expect something like
/Applications/MATLAB_R2019a.app/toolbox/matlab/graphics/printing/print.m
and a series of items marked as "method".
I suspect you have part of a Simulink model in your path.

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

채택된 답변

Shubh Sahu
Shubh Sahu 2019년 8월 29일
It seems that you have save any file with name ‘print.m’ that might be the reason whenever you are trying to copy or print, the inbuilt print function gets overloaded by the new file in the system. So, try to find that file and delete it and cross verify it by typing
which -all print
and you should get results something like this
C:\Program Files\MATLAB\R2019a\toolbox\matlab\graphics\printing\print.m
print is a Java method % com.mathworks.hg.util.InfoPanel method
print is a Java method % com.mathworks.mwswing.MJPanel method
print is a Java method % javax.swing.JPanel method
print is a Java method % javax.swing.JComponent method
print is a Java method % java.awt.Container method
print is a Java method % java.awt.Component method
C:\Program Files\MATLAB\R2019a\toolbox\mbc\mbctools\@mdev_local\print.m % mdev_local method
C:\Program Files\MATLAB\R2019a\toolbox\mbc\mbctools\@modeldev\print.m % modeldev method
and You have alternative way that is go to
File-> Save as-> change save type to your requirements

추가 답변 (1개)

Dustin Ho
Dustin Ho 2019년 9월 3일
Thanks alot. I got the problem as there are accidently two functions with the same name print.m in the MATLAB source code. One is built-in funtion while the second is from the ARDrone with MATLAB toolbox written by MATLAB staff.
Since the extra toolbox is also official, then MATLAB tried to call the print.m in the toolbox whenever I want to copy or export figure. Now I deactive the toolbox in the path, that fixed the problem.

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by