PDE toolbox, specifying coefficients, error telling me "Function specifying a coefficient must accept two input arguments and return one output argument."
1 view (last 30 days)
I keep running into the error while I am specifying f coefficient and the problem is I do not know why.
It would be very much appreciated if somebody kindly point me into the right direction. I have given my code below.
clc; tic; % Clears the screen
model = createpde();
rect1 = [3,
results = solvepde(model);
function f = fcoeffunction(location,state)
N = 1; % Number of equations
nr = length(location.x); % Number of columns
f = zeros(1,nr); % Allocate f
Ravi Kumar on 12 Nov 2020
The function "fcoeffunction", does not have definitions of e, L, C, mu, r, o, etc. in its scope. Move the definitions in the begining to inside of this function. You can also put a breakpoint on the first line of the function and step through it to find all the missing variable definition.