MATLAB: Problems with legend

legend

hello, in my program i have the following plots:
u = [0.4 mnd12005lu];
q = mnd12005sd;
g = [q(1:end-2) ;q(2:end-1); q(3:end)];
t = [0 0 0]; % vektor for de tre første dager (29. des, 1 og 2 jan) for snødybde ved bruk til kristiansentrippel.
zeiglersum = ((2*pi).*mnd12005lu' + 3.6.*mnd12005sd')';
foerdesfaktor = (4.7.*mnd12005lu' + 0.3.*mnd12005sd'.^2)';
grinismaksimum = max(u(1:end-1),u(2:end));
kristiansenstrippel = [mean(t) mean(g)];
hennestadsminimum = min (zeiglersum, grinismaksimum) - 5;
plot (zeiglersum, 'k-')
axis([0 32 -inf inf])
legend ('zeiglersum','foerdesfaktor,'-4.*grinismaksimum', '3.*kristiansenstrippel', 'hennestadsminimum')
hold on
plot(foerdesfaktor, 'm --','linewidth',2)
hold on
plot(-4.*grinismaksimum, 'c : .')
hold on
plot(3.*kristiansenstrippel, 'r -.')
hold on
plot(hennestadsminimum, 'g :')
hold off
When i run the plot, only the legend for 'zeiglersum' shows up. i also get the following message:
Warning: Ignoring extra legend entries. > In legend at 294 In OBLIG2 at 63
OBLIG2 is the program

Best Answer

Move the legend() call to below the place you plot the last value.
I believe, by the way, that you are missing an "'" immediately after "'foerdesfaktor" in your legend() call.