www.gusucode.com > pde 案例源码 matlab代码程序 > pde/InterpolateScalarEigenvalueResultsExample.m
%% Interpolate Scalar Eigenvalue Results % Solve a scalar eigenvalue problem and interpolate one eigenvector to a % grid. %% % Find the eigenvalues and eigenvectors for the L-shaped membrane. model = createpde(1); geometryFromEdges(model,@lshapeg); applyBoundaryCondition(model,'dirichlet','edge',1:model.Geometry.NumEdges,'u',0); specifyCoefficients(model,'m',0,... 'd',1,... 'c',1,... 'a',0,... 'f',0); r = [0,100]; generateMesh(model,'Hmax',1/50); results = solvepdeeig(model,r); %% % Interpolate the eigenvector corresponding to the fifth eigenvalue to a % coarse grid and plot the result. [xq,yq] = meshgrid(-1:0.1:1); uintrp = interpolateSolution(results,xq,yq,5); uintrp = reshape(uintrp,size(xq)); surf(xq,yq,uintrp)