0.1 ラジアンのスリットを持つメッシュがあります。
mesh = makeSlitMesh(0.1,5)
その内容
p: [2x188 double]
t: [3x330 double]
edges: [2x517 double]
t2e: [3x330 double]
e2t: [2x517 double]
get_solution_at_xy関数の私のパラメータ:
>> x = randn(100,1);
>> y = randn(100,1);
以下のコードの関数を実行します
get_solution_at_xy(@(x,y) sin(pi*x) .* sin(pi*y), メッシュ, x, y)
そしてエラーを取得します
Error using TriScatteredInterp
Sample values must be a double array.
Error in get_solution_at_xy (line 18)
F=TriScatteredInterp(mesh.p(1,:)',mesh.p(2,:)',uh);
配列xとyを転置しましたが、それでも同じエラーが発生します。配列は 2 倍です。
このエラーの原因は何ですか?
get_solution_at_xy 関数
% Evaluates the FEM function "uh" defined on "mesh" at the points x,y
%
% CALLING SYNTAX IS
%
% function val = get_solution_at_xy(uh,mesh,x,y)
%
% uh = FEM function to be evaluated
% mesh = trimesh structure on which the FEM function is defined
% x = x coordinates of the evaluation points
% y = y coordinates of the evaluation points
%
% val = value of the FEM function evaluated at the points x,y
%
function val = get_solution_at_xy(uh,mesh,x,y)
F=TriScatteredInterp(mesh.p(1,:)',mesh.p(2,:)',uh);
val=F(x,y);
end