Why do I get the error "Undefined 'matlab.gr​aphics.ill​ustration.​internal.g​etLegendab​leChildren​'" when using the function 'legend'?

조회 수: 6 (최근 30일)
I recently updated my MATLAB release to R2018b. I obtain an error when using the "legend" command, as it happens in the example below:
>> clear
>> close all
>> figure,plot(0,1)
>> legend('Test')
Undefined function or variable 'matlab.graphics.illustration.internal.getLegendableChildren'.
Error in legend (line 261)
make_legend(ha,args(arg:end),version);

채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 11월 15일
편집: MathWorks Support Team 2019년 11월 15일
This error may be due to the file containing the legend functions not being correctly located. Please check that it can actually be found in the MATLAB path by executing:
>> which -all matlab.graphics.illustration.internal.getLegendableChildren
The output of this command should be something like:
<matlabroot>\toolbox\matlab\graphics\illustration\+matlab\+graphics\+illustration\+internal\getLegendableChildren.m
where 'matlabroot' is the output of the homonymous command.
In case it cannot be found from within MATLAB, please navigate to the respective "+internal" folder (as in the example path above), and check that the file "getLegendableChildren.m" is actually there.
If the file is not present in this folder, it may be that your MATLAB installation is incomplete. You would then need to re-install it.
If the file is present inside the "+internal" folder, please restore the default path in order to fix your issue. You can do this by executing the following in MATLAB Command Window:
>> restoredefaultpath
>> rehash toolboxcache
After doing so, you should be able to use MATLAB normally. Please check that the issue is fixed, and if that is the case, please save the new MATLAB search path by executing the following command in MATLAB Command Window:
>> savepath

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by