Extracting points from an interpolated surface (Lowess fit)
Mostrar comentarios más antiguos
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 comentario
Walter Roberson
el 14 de Jul. de 2012
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 29 de Jul. de 2012
0 votos
Categorías
Más información sobre Smoothing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!