How to plot a vector using stem?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jorge Montane
el 25 de En. de 2018
Respondida: Star Strider
el 25 de En. de 2018
I want to plot x = [0 2 3 2 1 -1]. I am new in Matlab and am having issues on exactly how to plot this. I also need to plot x = [0 3 1]. x = [0 1 2 2.5 3 2.5 2 1.5 1 0 -1] . I dont want the exact code (although wouldn't mind) but I would like some guidance on how to plot.
0 comentarios
Respuesta aceptada
Star Strider
el 25 de En. de 2018
It is difficult to respond without providing at least some code. See the documentation for the stem (link) function for details.
For your first plot, try this:
x = [0 2 3 2 1 -1];
figure(1)
stem(x, 'filled')
set(gca, 'XLim',[0 numel(x)+1])
Ideally, you should also have an independent variable vector, however if you do not supply one, MATLAB will plot them sequentially with a ‘step’ of 1.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Stem Plots 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!