How to plot the graph of Greatest Integer Function ?

9 visualizaciones (últimos 30 días)
Vipul Sharma
Vipul Sharma el 8 de Jun. de 2016
Respondida: Sumit el 10 de Oct. de 2023
I was trying to plot greatest integer function by using floor command and stem (to show discontinuity) but what i am getting is,please help me out!!!
I used the code
x=linspace(1,10,10) y=floor(x); stem(x,y)
  2 comentarios
Jos (10584)
Jos (10584) el 8 de Jun. de 2016
What did you expect to see?
Eric Strobel
Eric Strobel el 17 de En. de 2021
This is close, I got this using the code below:
Dots are right, lines are going wrong way.
Code:
syms y
>> y=floor(x); x=linspace(1,10,10); stem(x,y)

Iniciar sesión para comentar.

Respuestas (4)

Jos (10584)
Jos (10584) el 8 de Jun. de 2016
x=linspace(1,10,10)
y=floor(x) % ARE THESE VALUES AS EXPECTED??
stairs(x,y) % rather than stem
  1 comentario
Vipul Sharma
Vipul Sharma el 8 de Jun. de 2016
Sorry brother,but this is showing a continuous graph whereas the greatest integer function is a discontinuous function,sorry but this plot is wrong

Iniciar sesión para comentar.


Vipul Sharma
Vipul Sharma el 8 de Jun. de 2016
Sorry brother,but this is showing a continuous graph whereas the greatest integer function is a discontinuous function,sorry but this plot is wrong

Vipul Sharma
Vipul Sharma el 8 de Jun. de 2016

Sumit
Sumit el 10 de Oct. de 2023
x=1:0.001:10;
y=floor(x);
plot(x,y,'.');

Categorías

Más información sobre Title en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by