Cannot save Fig as PNG -- Matlab bug?

I think there's a problem with Matlab. I'm unable to save a figure as png, using the basic command "saveas(gcf, 'test.png')". The figure does exist. The error is at the end of this message. Thoughts?
>> gcf
ans =
Figure (2) with properties:
Number: 2
Name: ''
Color: [0.9400 0.9400 0.9400]
Position: [680 678 560 420]
Units: 'pixels'
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.3.0.713579 (R2017b)
MATLAB License Number: xxxxxxxxxx
Operating System: Microsoft Windows 7 Professional Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.3 (R2017b)
Simulink Version 9.0 (R2017b)
Control System Toolbox Version 10.3 (R2017b)
Curve Fitting Toolbox Version 3.5.6 (R2017b)
Data Acquisition Toolbox Version 3.12 (R2017b)
Image Processing Toolbox Version 10.1 (R2017b)
MATLAB Coder Version 3.4 (R2017b)
Optimization Toolbox Version 8.0 (R2017b)
Signal Processing Toolbox Version 7.5 (R2017b)
Simulink Coder Version 8.13 (R2017b)
Simulink Control Design Version 5.0 (R2017b)
Simulink Design Optimization Version 3.3 (R2017b)
Simulink Desktop Real-Time Version 5.5 (R2017b)
Stateflow Version 9.0 (R2017b)
Statistics and Machine Learning Toolbox Version 11.2 (R2017b)
Symbolic Math Toolbox Version 8.0 (R2017b)
System Identification Toolbox Version 9.7 (R2017b)
Here is the error:
>> saveas(gcf, 'test.png')
Error using print (line 82)
Invalid MEX-file 'C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64':
Missing symbol 'OpenProcess' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-Synch-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'FileTimeToSystemTime' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-File-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'GetNamedPipeAttribute' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-NamedPipe-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'SystemTimeToTzSpecificLocalTime' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'TzSpecificLocalTimeToSystemTime' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'GetDynamicTimeZoneInformation' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'GetTimeZoneInformationForYear' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'SystemTimeToFileTime' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'GetTimeZoneInformation' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\KERNEL32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\VCRUNTIME140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\MSVCP140.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwresource_core.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'FileTimeToSystemTime' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-File-L1-1-0.dll' required by
'C:\Windows\system32\msvcrt.dll->C:\Windows\system32\ADVAPI32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\boost_filesystem-vc140-mt-1_56.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'GetTimeZoneInformation' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\msvcrt.dll->C:\Windows\system32\ADVAPI32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\boost_filesystem-vc140-mt-1_56.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'SystemTimeToFileTime' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\msvcrt.dll->C:\Windows\system32\ADVAPI32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\boost_filesystem-vc140-mt-1_56.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'FileTimeToSystemTime' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-File-L1-1-0.dll' required by
'C:\Windows\system32\RPCRT4.dll->C:\Windows\system32\ADVAPI32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\boost_filesystem-vc140-mt-1_56.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwi18n.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'OpenProcess' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-Synch-L1-1-0.dll' required by
'C:\Windows\system32\dbghelp.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwfl.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'LoadStringA' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-LibraryLoader-L1-1-0.dll'
required by 'C:\Windows\system32\WS2_32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\boost_log-vc140-mt-1_56.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwfl.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'LoadStringW' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-LibraryLoader-L1-1-0.dll'
required by 'C:\Windows\system32\WS2_32.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\boost_log-vc140-mt-1_56.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwfl.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'LoadStringW' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-LibraryLoader-L1-1-0.dll'
required by
'C:\Windows\system32\ole32.dll->C:\Windows\system32\OLEAUT32.dll->C:\Windows\system32\SETUPAPI.dll->C:\Windows\system32\POWRPROF.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwfl.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'OpenProcess' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-Synch-L1-1-0.dll' required by
'C:\Windows\system32\ole32.dll->C:\Windows\system32\OLEAUT32.dll->C:\Windows\system32\SETUPAPI.dll->C:\Windows\system32\POWRPROF.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwfl.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'
Missing symbol 'SystemTimeToFileTime' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-SysInfo-L1-1-0.dll' required by
'C:\Windows\system32\ole32.dll->C:\Windows\system32\OLEAUT32.dll->C:\Windows\system32\SETUPAPI.dll->C:\Windows\system32\POWRPROF.dll->C:\Program
Files\MATLAB\R2017b/bin/win64\libmwfl.dll->C:\Program
Files\MATLAB\R2017b\toolbox\matlab\imagesci\private\pngwritec.mexw64'.
Error in saveas (line 181)
print( h, name, ['-d' dev{i}] )

댓글 수: 4

Image Analyst
Image Analyst 2018년 5월 21일
Can you save it by using the little disk icon on the figure's toolbar?
Missing symbol 'OpenProcess' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-Synch-L1-1-0.dll'
This seems to be serious: Several functions of the Windows KERNEL32 library are not found. Did it run before you have modified anything?
While the slashes are okay as file separator under Windows, I actually expect backslashes around the "bin" folder.
Stephen23
Stephen23 2018년 5월 23일
John's "Answer" moved here:
Update: I am able to save as jpg using the above command. However, as stated, png throws the error
Jan, yes, everything else seems to run fine.
Did you find a solution to that error? I get the exact same error message:
Missing symbol 'OpenProcess' in 'C:\Program
Files\MATLAB\R2017b/bin/win64\API-MS-Win-Core-Synch-L1-1-0.dll'
My program used to run until one hour ago and I did not change anything that I would know of...

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

답변 (1개)

John
John 2018년 5월 22일

0 개 추천

Again, PNG does not work. Anyone have further thoughts?

댓글 수: 1

Walter Roberson
Walter Roberson 2018년 5월 22일
I would recommend contacting Mathworks support.

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

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2018년 5월 21일

댓글:

2018년 8월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by