Plotting the outcome of a 3D fit
Show older comments
I have a set of data in the form [X Y Z] where X, Y and Z are column arrays. I can plot these data using scatter3. However, when I do the fit and then try to plot a surface of the fit with new Xf & Yf values in a range that is a bit beyond the original X & Y, I try this:
XYZFitCoefficinets=fit([X Y],Z,"poly22")
Xf=linspace(0,30,100)'; Yf=linspace(40,140,100)';
Zf=feval(XYZFitCoefficinets,[Xf, Yf])
I get another column array that just shows the calculated points, whereas I need a surface. I know that I need to use the surf function and turn Xf and Yf into mesh grids, but apparently it is not possible to use the feval with meshgridded X & Y. So what can i do?
Accepted Answer
More Answers (0)
Categories
Find more on Scatter 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!