Hi AlireaA
You are on the right track by breaking this problem into two parts. Let's look at the first part
yp1 = ztrans((1/3)^n)
yp1 =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1193203/image.png)
Yp = yp1-yp2
Yp =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1193208/image.png)
YPs = simplify(Yp)
YPs =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1193213/image.png)
That result is correct, and could also have been obtained as follows:
sympref('HeavisideAtOrigin',1);
simplify(ztrans((1/3)^n*u(n-2)))
ans =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1193213/image.png)
We can use ztrans here because the sequence in question is zero for n < 0. Also, it's very important to note that the Region of Convergence (ROC) for Yps is abs(z) > 1/3.
Now, moving onto the second component .... it looks like you're trying to use symsum to compute the z-transform explicitly. However, because the sequence is left-sided we need to use the bi-lateral z-transform (which I'm sure is the point of the exercise). Furthermore, because the sequence is zero for n > -1, we can take the sum from -inf to -1 (instead of -inf to inf),
v = symsum(y1,n,-inf,-1)
v =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1193218/image.png)
The z-transform of this sequence only coverges over the ROC abs(z) < 2. Combined with result above, the ROC for the z-transform of the sum of the two sequences is
assume(1/3 < abs(z) < 2);
Recompute v with this assumption to get a compact form
v = simplify(symsum(y1,n,-inf,-1))
v =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1193223/image.png)
BTW, you could also have obtained this result from a standard, z-transform table.
Consequently, the z-transform of x[n] is
X(z) = YPs + v
X(z) =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1193228/image.png)
with ROC
assumptions(z)
ans =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1194438/image.png)