matlab m文件参数传递,请问这个.m文件的参数传什么?

最近要做四参数拟合

公式为:y = (a-d)/(1+(c/x).^b)+d

给出5组数据,需要求出相应的abcd的值.

由于对算法一块不是很熟.只能靠matlab来做,网上找到了一个ec50.m的文件来做四参数拟合

主文件内容

function results=ec50(conc,responses)

% EC50 Function to fit a dose-response data to a 4 parameter dose-response

%   curve.

%

% Requirements: nlinfit function in the Statistics Toolbox

%           and accompanying m.files: init_coeffs.m and sigmoid.m

% Inputs: 1. a 1 dimensional array of drug concentrations

1. 一个浓度的一维数组

%         2. the corresponding m x n array of responses

2. 相应的m*n矩阵结果

% Algorithm: generate a set of initial coefficients including the Hill

%               coefficient

%            fit the data to the 4 parameter dose-response curve using

%               nonlinear least squares

% Output: a matrix of the 4 parameters

%         results[m,1]=min

%         results[m,2]=max

%         results[m,3]=ec50

%         results[m,4]=Hill coefficient

%

% Copyright 2004 Carlos Evangelista

% send comments to CCEvangelista@aol.com

% Version 1.0    01/07/2004

%conc = conc';

%responses = responses';

[m,n]=size(responses);

results=zeros(n,4);

for i=1:n

response=responses(:,i);

initial_params=init_coeffs(conc,response);

[coeffs,r,J]=nlinfit(conc,response,'sigmoid',initial_params);

%    disp (coeffs);

for j=1:4

results(i,j)=coeffs(j);

end

end

%disp (results);

% Inputs: 1. a 1 dimensional array of drug concentrations

1. 一个浓度的一维数组

%         2. the corresponding m x n array of responses

2. 相应的m*n矩阵结果

2到底是什么

因为公式中x为浓度,

因此conc应该是浓度

2我就搞不明白了.

我只有5组数据

respon= [22929;62436;283398;817634;1483682]

这样错误,提示

??? Error using ==> rdivide

Matrix dimensions must agree.

Error in ==> init_coeffs at 17

if (y(1)-y(sizey))./(x(2)-x(sizex))>0

Error in ==> ec50 at 28

initial_params=init_coeffs(conc,response);

respon= [22929,62436,283398,817634,1483682]

也不对

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值