How can I plot this solution to Laplace's equation?
Afficher commentaires plus anciens
I have this solution to Laplace's equation with specific boundary conditions (not necessary for question)

I am trying to plot this in 3D with the code:
x=0:.01:3;
y=0:.01:2;
[X, Y]=meshgrid(x, y);
uxy=zeros(size(X));
for n=1:20
cn=(8*sin(n*pi/2))/(n^2*pi^2*sinh(3*n*pi/2));
uxy=uxy+cn*sinh(n*pi*x/2).*sin(n*pi*y/2);
end
surf(X, Y, uxy)
It keeps telling me that my inner matrix dimensions must agree yet I cannot figure out how to fix this. If you could help me plot this, that would be great. Thanks!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
