I would normally ask why not try it yourself, but I realize there are some issues that can easily catch you here.
First, you need to capture the handle to the object you just plotted. rotate uses that to do its work.
Next, you need to recognize the units on the axes are relatively different. When you plot a figure, MATLAB auto-scales the axes to make the plot look good, at least by some guess as to what looks good. So in my first figure, the y axis varies by roughly 40 units in y, but over a distance that is here roughly the same as about 400 units of travel on the x axis. So while we see all of the stuff that happens. you need to be VERY careful in what you see when you rotate that plot, with aes that are auto-scaled, by 20 degrees.
So, first, I'll force MATLAB to essentially disable that auto-scaling.
Now the figure is plotted with axes that have the same "units". As you can see in this version, there really is little variation in y, compared to the variation seen in x.
I did not really need to make the axes tight. But I did so here to make it clear what MATLAB did. Here, one unit of distance traveled in y is now comparable to distance traveled in x. That distinction is crucial to understanding what it means to rotate the plot.
The above difference is crucial, for example, if you plot a circle on a new figure in MATLAB, you will see what appears to be an ellipse! For example:
t = linspace(0,2*pi,100); plot(cos(t),sin(t),'-')
While we know the circle I plotted MUST absolutely be a circle, it looks like an ellipse. The plotting artifact is purely one of axis scaling, that even though the data is circular, if you are not careful with the plot, it need not look circular.
Anyway, now rotating the original figure by 20 degrees should makes sense. How do we use rotate? BE VERY CAREFUL! Why do I say that? Because if you do not, then you will get a result that does not actually look as if it has been rotated by 20 degrees.
What is the axis of rotation? What origin will the plot be rotated around?
I'll assume you wanted to rotate the curve itself, not the entire figure. So I'll arbitrarily choose the center of rotation to be the very first data point, with z==0 there, because rotate really thinks in 3 dimensions. If you don't supply a center of rotation, the result will be rotated around the center of the plot window! And that point need not even be on the curve.
The axis of rotation will be around the z axis. So we will spin the plot in the (x,y) plane. That axis of rotation will be given by the vector [0 0 1]. This time, I'll leave out the axis tight call, to make it clear that the first data point plotted is still the same. That could become confusing if I used axis tight.
H = plot(t,sdata);
rotate(H,[0 0 1],20,[t(1),sdata(1),0])
So now the curve has been clearly rotated by +20 degrees around the origin [0,0] in the x-y plane. The result is a curve with still relatively little deviation from a straight line, but now at an inclination of 20 degrees more than it had in the beginning.
If you don't do as I said in the above steps, you can get what may be a confusing result, but really, it comes down to understanding how MATLAB does the scaling of their axes, and understanding what that implies when you want to rotate a curve in space.