How do I make a stem plot in MATLAB?

How do I make an input sequence named n with a step of 1, ranging from -10 to 10?
Once I do that, how then do I make a stem plot of a function of n.
Then how to label both the x and y axes and add titles?

 Respuesta aceptada

Paulo Silva
Paulo Silva el 18 de Feb. de 2011
n=-10:10;
a=0*n;
a(n>=0)=1;
stem(a)
xlabel('this is the x label')
ylabel('this is the y label')
title('this is the title')

Más respuestas (1)

RAMA ARAVINTH
RAMA ARAVINTH el 24 de Jun. de 2021

1 voto

n=-10:10;
a=0*n;
a(n>=0)=1;
stem(a)
xlabel('this is the x label')
ylabel('this is the y label')
title('this is the title')

Categorías

Más información sobre Labels and Annotations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 18 de Feb. de 2011

Respondida:

el 24 de Jun. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by