필터 지우기
필터 지우기

Error while evaluating Menu Callback.

조회 수: 31 (최근 30일)
Jordi
Jordi 2022년 12월 1일
답변: Jordi 2022년 12월 29일
Hi, I can't properly save a picture. When I try to save a figure (File > Save As or Save) the following error appears: "Error while evaluating Menu Callback.". Which is weird because I could do it with the same code a week ago. I've managed to save some pictures trough the shortcut that appears on the top right corner of a figure, which allows to "Save As" or "copy image". But this doesn't work with a subplot, as it saves each subplot separately.
I tried "restoredefaultpath" and reinstalled matlab but it didn't fix it. How can I solve it?

채택된 답변

Jordi
Jordi 2022년 12월 29일

추가 답변 (1개)

Suchitra
Suchitra 2022년 12월 6일
Hello Jordi,
I can understand that you are facing an issue when trying to use File > Save, File > Save As to save a figure.
In order to resolve this issue, please refer to the following workaround:
Use the following MATLAB Command instead of using the File > Save dialog:
>> saveas('figurename.fig')
With regards to the cause of the issue, it is possible that one of the built-in toolbox functions may have become shadowed or corrupted. In order to best proceed, you can execute the following command
>> which -all filemenufcn.m
This command should return a path similar to:
C:\ProgramFiles\MATLAB\R2022b\toolbox\matlab\uitools\filemenufcn.m
If it does, try to open this file in the MATLAB Editor to see if it has become corrupted. It may also be worth renaming this file and then copying the same file from your other MATLAB installation on your notebook, in which you are not receiving this same error into this directory, rather than uninstalling and completely reinstalling MATLAB.
See also:
Hope this helps!
  댓글 수: 1
Jordi
Jordi 2022년 12월 6일
Hello Suchitra,
Thanks for the help.
When I open filemenufcn.m in the editor it seems to be okay. I tried to use saveas(gcf, 'Filename.fig') and it works fine, but I don't know how to convert it to .png or .jpg. On the other hand, when using >> saveas(gcf,'Filename.png') I get the following error:
Failed to load bundle #770: C:\Program Files\MATLAB\R2022b\bin\win64\sl_utility.dll
I can't recover the filemenufcn.m from the first installation either. Are there any other options?

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

카테고리

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

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by