3D from multiple 2D curves

1 view (last 30 days)
Ivo Grigoli on 14 Nov 2021
Edited: William Rose on 14 Nov 2021
Hello everyone, I have a question:
I have imported different curves with the help of txt files (see picture). Now I want to put these curves together in one figure, but always rotated by 5° around the Z-axis. At the end it should be a 3D surface.
I hope someone can help me, i`ve not been working with matlab for long :)
.

William Rose on 14 Nov 2021
Edited: William Rose on 14 Nov 2021
Suppose you have M different curves y1(x), y2(x),...,yM(x), and they each have N points. Let's assume you also have the vector x which is 1 by N.
Define y=1:M.
Put the curves into a 2D matrix z(i,j) which is N by M.
Plot it with surf(x,y,z).
Once you have plotted it, you will notice a little cube-inside-a-circle icon at top right. Click it to enable plot rotation by clicking and dragging. When you click and drag, it shows you the perspective angle, so you can adjust it to 5 degrees if you like.