matlab拟合一组数据到某一函数

来源:百度知道 编辑:UC知道 时间:2024/07/01 01:37:00
x=[120 140 150 165 180 195 210 230 250 300];
y=[0.000025 0.000021 0.000020 0.000016 0.000010 0.000010 0.000010 0.0000095 0.0000095 0.0000093];
拟合到y=a/x+b
给出较为具体的程序或者提示

代码如下:
function fffff(x,y)
%FFFFF Create plot of datasets and fits
% FFFFF(X,Y)
% Creates a plot, similar to the plot in the main curve fitting
% window, using the data that you provide as input. You can
% apply this function to the same data you used with cftool
% or with different data. You may want to edit the function to
% customize the code and this help message.
%
% Number of datasets: 1
% Number of fits: 1

% Data from dataset "y vs. x":
% X = x:
% Y = y:
% Unweighted
%
% This function was automatically generated on 13-Apr-2009 22:48:43

% Set up figure to receive datasets and fits
f_ = clf;
figure(f_);
set(f_,'Units','Pixels','Position',[160 92 680 484]);
legh_ = []; legt_ = {}; % handles and text for legend
xlim_ = [Inf -Inf]; % limits of x axis
ax_ = axes;
set(ax_,'