Error using print (line 82)

조회 수: 9 (최근 30일)
ArchNW
ArchNW 2017년 5월 27일
답변: ArchNW 2018년 10월 19일

I am getting the following error intermittently while printing figures off to Excel workbooks. The error is not consistent. The script writes multiple figures to multiple pages of a workbook then goes back and starts the process over with new data. The program works on a workstation running Windows XP using Matlab 2014a. It is throwing the error on a Windows 10 PC using Matlab 2016b and 2017a. Basic code updates for differing Matlab versions have been made to the figure generating code. Frustratingly for tracking down the source of the error, sometimes it will run through no problem. For instance, the code had run correctly 7 times before throwing the error below. Norton antivirus is not being used, noted here because that seems to be something that will cause problems using clipboard. The error report runs:

Error using print (line 82) Java exception occurred: java.lang.IllegalStateException: cannot open system clipboard

at sun.awt.windows.WClipboard.openClipboard(Native Method)

at sun.awt.windows.WClipboard.setContentsNative(Unknown Source)

at sun.awt.datatransfer.SunClipboard.setContents(Unknown Source)

at com.mathworks.hg.uij.ExportClipboardHelper.copyToClipboard(ExportClipboardHelper.java:107)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.mathworks.jmi.AWTUtilities$Invoker$3$1.call(AWTUtilities.java:525)

at com.mathworks.mvm.context.ThreadContext.callWithContext(ThreadContext.java:105)

at com.mathworks.mvm.context.MvmContext.callWithContext(MvmContext.java:113)

at com.mathworks.jmi.AWTUtilities$Invoker$3.runWithOutput(AWTUtilities.java:522)

at com.mathworks.jmi.AWTUtilities$Invoker$2.watchedRun(AWTUtilities.java:475)

at com.mathworks.jmi.AWTUtilities$WatchedRunnable.run(AWTUtilities.java:436)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEventImpl(Unknown Source)

at java.awt.EventQueue.access$200(Unknown Source)

at java.awt.EventQueue$3.run(Unknown Source)

at java.awt.EventQueue$3.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Error in MCA_Univariate_Tbl_Long_WOBD (line 731) print(gcf, '-dbitmap','-r0');

Error in run (line 86) evalin('caller', [script ';']);

Error in MCA_Run_Control_WOBD_A (line 435) run('MCA_Univariate_Tbl_Long_WOBD.m');

  댓글 수: 1
Derek Hutton
Derek Hutton 2018년 8월 6일
I am having this same issue. It started with I upgraded to Windows 10 and MATLAB 2017b. Did you ever find a resolution?

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

답변 (1개)

ArchNW
ArchNW 2018년 10월 19일
Derek,
Nope. Sorry. It is still a mystery.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by