Showing x-axis & y-axis

hello am supposed to use fplot command to plot the function sin(x)+cos(0.75x) in the interval [0 15]
so i write :
fplot('sin(x)+cos(0.75*x)',[0 15])
The problem is that there is no y-axis and x-axis in the graph how can i display them?
NOTE: am using Matlab 6.1

Respuestas (4)

talal abulnaja
talal abulnaja el 29 de Mzo. de 2023

4 votos

try
xline(0);
yline(0);
Paulo Silva
Paulo Silva el 1 de Mzo. de 2011

1 voto

After plotting that function do:
get(gca)
See the last property, visible, if it's off turn it on
axis on
I don't have that version of matlab, sorry if my answer doesn't help you.
Swati Bhargava
Swati Bhargava el 3 de Sept. de 2022
Editada: Swati Bhargava el 3 de Sept. de 2022

0 votos

I am facing same issue when using fplot. I tried using axis on, but that does not help! Using grid on helps, but creates entire grid!
axis on; %does not help
grid on %helps, but more lines than needed!

Categorías

Más información sobre Line Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 1 de Mzo. de 2011

Respondida:

el 29 de Mzo. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by