Dear all 

I have a question related to Mathematical equation which we write in MATLAB. I have set of points which I have attach with this message. The code is also attach with this message.

evalpoints[10201*2] x and y of the function equation, 1st and 2nd column of exel file

% datapoints [2500*2] xi and yi of the function equation, 3rd and 4th column of exel file

% function equation is f = a1+a2*x+a3*y+phi(r)...... this is a 2nd order equation

%f = a1+a2*x+a3*y+r.^2*ln(r)

%f = a1+a2*x+a3*y+((x-xi)^2+(y-yi)^2)*log(sqrt((x-xi)^2+(y-yi)^2)) (1)

% Equation (1) will be written in form of MATLAB as below

[numeval,evaldim]=size(evalpoints);

[numdata,datadim]=size(datapoints);

evalsquares=sum(evalpoints.^2,2);

datasquares=sum(datapoints.^2,2);

fullmat=[rbf(sqrt(repmat(evalsquares,1,numdata)+repmat(datasquares,1,numeval)'...

-2*evalpoints*datapoints')) ones(numeval,1) evalpoints];

% (sqrt(repmat(evalsquares,1,numdata)+repmat(datasquares,1,numeval)'-2*evalpoints*datapoints')) ones(numeval,1) evalpoints is basically r

%we will get a matrix fullmat of size [10201*2503]

% My question is if we take the derivative of given function equation (1) wrt y I get another equation which is derivative of equation (1)

%diff(f,y)= a3 + y - y1 + log(((x - x1)^2 + (y - y1)^2)^(1/2))*(2*y - 2*y1) (2)

% How we can write derivative of equation (1) which is equation (2) in form of MATLAB code so wo get same size of matrix [10201*2503]??????

Kindly reply me.

I will be very thankfull to you.

I am stuck on this part 

More Zuhaib Nazir's questions See All
Similar questions and discussions