I would like to be able to export fit residual values. Is this possible? If so how?

%%Thin-Plate Spline smoothing
figure( 'Name', 'Thin-Plate Spline' );
st = tpaps(xydata',cddata'); % requires data to be in coloumns not rows
subplot(2,1,1);
fnplt(st), hold on
plot3(xydata(:,1),xydata(:,2),cddata,'wo','markerfacecolor','k')
% Label axes
title('Thin-Plate-Spline fit to input CD map');
xlabel( 'xcom' );
ylabel( 'ycom' );
zlabel( 'CD' );
grid on
avals = fnval(st,xydata');
residual = cddata - avals';
subplot(2,1,2);
plot3(xydata(:,1),xydata(:,2),residual,'wo','markerfacecolor','k')
% Label axes
%xlabel( 'xcom' );
title('Fit residual');
ylabel( 'ycom' );
zlabel( 'CD residual' );
view([90 0]);
grid on
CDsigma = std(cddata);
ResidualSigma = std(residual);

Answers (1)

That's hard to read (consider formatting it as code), but it appears to create a variable named "residual" in the workspace. Is that what you mean by exporting residuals? If not, please clarify.

Asked:

on 14 Aug 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!