Extracting points from an interpolated surface (Lowess fit)
Afficher commentaires plus anciens
Hey Guys,
I have made a surface using the lowess fit from a non uniform set of data points. I am only able to read points from the surface only using the interactive data cursor by manually clicking on points.
I wanted to be able to extract points on the interpolated surface feeding in the x,y coordinates and extracting the z - coordinate. Please find the code below that I'm using.
Thanks in advance,
Hamed
Ratings = xlsread('SpreadMatrixFrontEnd10.xlsx','Consumer Goods122','B2:B122');
DTM = xlsread('SpreadMatrixFrontEnd10.xlsx','Consumer Goods122','A2:A122');
Yield = xlsread('SpreadMatrixFrontEnd10.xlsx','Consumer Goods122','C2:C122');
w= xlsread('SpreadMatrixFrontEnd10.xlsx','Consumer Goods122','D2:D122');
[xInput, yInput, zOutput, weights] = prepareSurfaceData( Ratings, DTM, Yield, w );
% Set up fittype and options.
ft = fittype( 'lowess' );
opts = fitoptions( ft );
opts.Span = 0.9;
opts.Weights = weights;
opts.Normalize = 'on';
% Fit model to data.
[fitresult, gof] = fit( [xInput, yInput], zOutput, ft, opts );
% Plot fit with data.
figure( 'Name', 'Consumer Goods' );
h = plot( fitresult, [xInput, yInput], zOutput );
% Label axes
xlabel( 'Ratings' );
ylabel( 'DTM' );
zlabel( 'Yield' );
grid on
1 commentaire
Walter Roberson
le 14 Juil 2012
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 29 Juil 2012
0 votes
Catégories
En savoir plus sur Multivariate Models dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!