Plot 2 functions red and blue with plot function

hello world,
I want to plot a function this two functions:
f1(n)= n* tan(n) and f2(n)= n+1; the fisrst with red color and the second with blue color with plot()
how can I do it?
thank you.

답변 (1개)

Star Strider
Star Strider 2020년 10월 10일

0 개 추천

Try this:
syms n
f1(n)= n* tan(n);
f2(n)= n+1;
figure
fplot(f1, [-pi pi], 'r')
hold on
fplot(f2, [-pi pi], 'b')
hold off
producing:
See the documentation for fplot for details on how to use it.

이 질문은 마감되었습니다.

질문:

2020년 10월 10일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by