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.

Risposte (1)

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.

Questa domanda è chiusa.

Richiesto:

il 10 Ott 2020

Chiuso:

il 20 Ago 2021

Community Treasure Hunt

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

Start Hunting!

Translated by