Using fit options to fit 3-D data using ft='linearinterp'. I only want to plot the fit and not the data used to make the fit. How do I do this?

3 visualizzazioni (ultimi 30 giorni)
SolutionSpace__settlingtime_zerocenter_K_50_B_15frictioncart_0_frictionpend_0_.jpg
I want to only plot the surface without the little blue dots (which is actually my original data). Is there an option to do this?
function [fitresult, gof] = createFit(x, y, z ,S)
%CREATEFIT(X,Y,Z)
% Create a fit.
%
% Data for 'untitled fit 1' fit:
% X Input : x
% Y Input : y
% Z Output: z
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
% Auto-generated by MATLAB on 21-Aug-2018 17:36:10
%% Fit: 'untitled fit 1'.
[xData, yData, zData] = prepareSurfaceData( x, y, z );
% Set up fittype and options.
ft = 'linearinterp';
% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, 'Normalize', 'on' );
% Plot fit with data.
%fig1 = figure(1);
%set(fig1,'rend','painters','pos',[10 10 1200 1200])
fig = figure('rend','painters','pos',[10 10 1200 1200])
h = plot( fitresult, [xData, yData], zData );
%legend( h, 'untitled fit 1', 'z vs. x, y', 'Location', 'NorthEast' );
%title(colorbar, 'Frequency')
grid on
grid minor
xlabel('Initial Angle (rad)')
%xlim([-0.9 0.65])
%xticks(-0.9:0.3:0.63)
ylabel('Frequency (Hz)')
%ylim([0.5 0.6])
%yticks(0.5:0.025:0.6)
zlabel('Transients Duration (s)')
% zticks(20:65:350)
%view(14.6, 21.2)
set(gca,'FontSize',24)
% Label axes
view( -23.1, 41.2 );

Risposta accettata

Matt J
Matt J il 9 Apr 2019
h = plot( fitresult)

Più risposte (0)

Categorie

Scopri di più su Fit Postprocessing in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by