Create a surface from several 1D plots
Show older comments
I have fitted several groups of scattered points (x,z) into 1D plots which vary on a third variable y. I now want to connect these discrete points in a 3D plot with the third axis being y. How would I go about doing this? I tried using the surf function but I need my y variable to be a matrix so I'm confused because for each entry in y (vector) a fitted (x,z) plot is created, so how could y be a matrix?
Apologies if I posed the question poorly and thank you.

Accepted Answer
More Answers (1)
KSSV
on 8 Sep 2021
0 votes
- See to it that all the curves have same dimensions. If not use interp1 and get them into same size.
- Initliaze matrices X, Y, Z with rows as number of curves and columns as number of points in each curve.
- Use surf on X, Y, Z.
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
