[Scilab-users] Command datafit for a bivarate model function z=f(x, y)

Jens j.s.strom at hslmg.de
Mon Dec 15 23:00:43 CET 2014


 I tried to follow the pattern for data fit given in the thread   
http://mailinglists.scilab.org/Convert-x-y-z-data-into-a-z-f-x-y-function-td4026897.html#a4026925
for the simple bivariate function
 z=p(1)*x.^2 + p(2)*y.^2 
by this script:

    mode(0),   lines(0),   clc(), clear
    deff( 'z=!z(x,y,p)','z=p(1)*x.^2 + p(2)*y.^2')//model function             
    pg=[5;6]//parameter of fictitious data
    X=[0:5];Y=[0:5]; Z=!z(X,Y,pg)
    M=[X;Y;Z];//measurement matrix, 3 rows, 6 colomns      
    deff(' e=!e(p,m)','x=M(1), y=M(2); z=M(3),e=z-!z(x,y)')//defect
(critereon- , error-,) function       
    p0=[2;3];
    [p,err]=datafit(1,!e,M,p0)
    err,
    z=!z(X,Y,p)

However the script just returns p0 as solution. Would anyone kindly help me
to find the flaw?

Kind regards
Jens




--
View this message in context: http://mailinglists.scilab.org/Command-datafit-for-a-bivarate-model-function-z-f-x-y-tp4031533.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list