|
From: | [gRO] Administrateur |
Subject: | [leasqr] about setting an external parameter of F that is not part of Pin vector |
Date: | Wed, 30 May 2007 10:07:02 +0200 (CEST) |
%parameter to be used in F(x,p,EQF) equation
EQF = Y{i}(1) - Y{i}(end);
%pins vector (initializations)
per = p;
%link to F
F = @func;
%leasqr
[f, p, kvg, iter, corp, covp, covr, stdresid, Z, r2] = ...
leasqr(X2,Y{i},per,F);
%called function as i wish to run
function y = func(x,p,EQF)
y = EQF*exp(p(1))*exp(p(2)*x)+p(3);
EQF = Y{i}(1) - Y{i}(end);
setappdata(0,'EQF',EQF);
%..........
%
%called function
function y = func(x,p)
EQF=getappdata(0,'EQF');
y = EQF*exp(p(1))*exp(p(2)*x)+p(3);
[Prev in Thread] | Current Thread | [Next in Thread] |