Why am I getting an error when using legend command

After installing R2014a, I have a consistent problem with functions and scripts that have worked in the past, specifically with the "legend" function. As an example, I wrote a simple script:
t = 0:.1:100;
x = [0:.1:100];
plot(t,x)
legend('y');
It produces the following error:
Error using flip
Too many input arguments.
Error in flipud (line 14)
x = flip(x,1);
Error in get_legendable_children (line 61)
ch = flipud(legkids(goodkid));
Error in graph2dhelper (line 31)
[varargout{1:nargout}] = feval(varargin{:});
Error in legend>make_legend (line 350)
children = graph2dhelper ('get_legendable_children', ha);
Error in legend (line 284)
[h,msg] = make_legend(ha,varargin(arg:end));
Error in Test (line 6)
legend('y');

5 comentarios

I can’t reproduce your error (R2014a). It works fine for me. You may want to Contact Support.
dpb
dpb el 27 de Jun. de 2014
If this doesn't go away with a restart of Matlab submit bug report/service request at mathworks.com
That clearly is just a bug.
The error being raised here is identical to that from profiler error with flip. The problem there was that there existed a custom flip function that was interfering with the MATLAB built-in one.
In the Command Window, type
which flip -all
and check the results. If a custom version of flip does exist, it will appear in this list (and so need to be renamed).
Ewww...Matlab namespace pollution strikes again! Soon there won't be any names left to use as TMW continues to introduce new stuff...
>> which flip
'flip' not found.
>>
In R2014a:
which flip -all
produces:
built-in (C:\Program Files\MATLAB\R2014a\toolbox\matlab\elmat\flip)

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Preguntada:

el 27 de Jun. de 2014

Comentada:

el 27 de Jun. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by