I'm trying to plots a graph for a difference equation, so that it plots a graph of X(n) for n=1,2,...,20, here's my code:
X(1)=-2;
for n=1:20;
X(n+1) = 0.5 * X(n) + 2;
end
I tried to store X(1) to X(20) as vector then plot the graph, however, it didn't work...and I am not sure what I've missed...
Thank you.
Hope this is helpful and you may try to expand this program.