Plotting the outcome of a 3D fit
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Scatter Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
