I'm trying to solve a 2D-PDE with a c coefficent in function form, but i'm having some trouble in using location struct.
here is my function for c coefficient:
function cmatrix = ccoeffunction(location,~)
n1 = 4;
nr = numel(location.x);
cmatrix = zeros(n1,nr);
cmatrix(1,:) = Ds*ones(1,nr);
cmatrix(2,:) = jv*(location.y)+jv*((location.y).^3)/3;
cmatrix(3,:) = -jv*(location.x)+Ds*((location.x)./(location.y));
cmatrix(4,:) = Ds*ones(1,nr);
However the location struct passed to the function contains in fields x and y just one zero, so my function doesen't work correctly.
struct with fields:
How can i pass to my function the correct location struct???