I am trying to omit the legend entry for graph b, but the following code still shows the curve in the legend. Thanks!
a = @(x) sin(x)
fplot (a,[1,10])
hold on
b = @(x) cos (x)
fplot (b,[1,10])
c = @(x) tan (x)
fplot (c,[1,10])
legend ('sinx','','tanx')

 채택된 답변

Star Strider
Star Strider 2015년 9월 14일

4 개 추천

The fplot function won’t let you do that, but plot will:
x = linspace(1,10);
a = @(x) sin(x);
ha = plot (x,a(x));
hold on
b = @(x) cos (x);
hb = plot (x,b(x));
c = @(x) tan (x);
hc = plot (x,c(x));
legend ([ha hc],'sinx','tanx')

댓글 수: 2

victoria yap
victoria yap 2015년 9월 15일
Thanks Star Strider! Works! :)
Star Strider
Star Strider 2015년 9월 15일
My pleasure!

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

추가 답변 (0개)

카테고리

태그

질문:

2015년 9월 14일

댓글:

2015년 9월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by