Hi @kaps
The error you're facing is likely related to how the source term “f” is defined in the “specifyCoefficients” function. In MATLAB's PDE Toolbox, “f” should be specified as a function handle that accepts the location and state structures, even if you only need the “x” and “y” coordinates.
Here's a modification to your code to resolve the issue:
% Define the coefficients for the PDE
specifyCoefficients(model,'m',0,'d',0,'c',1,'a',0,'f', @(location, state) sin(pi*location.x).* sin(pi*location.y));
For more details on “specifyCoefficients”, you can enter the following command in the MATLAB command window:
doc specifyCoefficients
Hope this helps.