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 (최근 30일)
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 );

채택된 답변

Matt J
Matt J 2019년 4월 9일
h = plot( fitresult)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by