Discrete vactors plotting problem

Pawel Jung le 23 Oct 2020
Dernière activité Réponse par Jeff Alderson le 23 Oct 2020

I would like to plot 2 discrete vectors on one graph created as follows: u=1; X={u,2*u,3*u,4*u,5*u,6*u,7*u,8*u,9*u}; Y={u,3*u,5*u,-u,-6*u,u-u,u^2,u^3,u^4}; stem(X,Y) unfortunately system returns error how to do it properly?

Jeff Alderson
Jeff Alderson le 23 Oct 2020

Please share the actual code you are using along with the MATLAB output. At first glance, the stem function (https://www.mathworks.com/help/matlab/ref/stem.html) requires X and Y to be vectors. The way you have them defined appears to be a cell array. Try using [ ] instead of { }.