Need help getting right orientation
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen

So they are asking for a 4by5 but i ended up with 5by4 with a 0row as the last row.
Am i doing something wrong?
Below is my code. Thanks in advance
a=5;
b=4;
T1=80;
k=5; %first 5 term
x=[1:1:5];
y=[1:1:4];
for x=1:1:5
for y=1:1:4
T(x,y)=0
for n=1:k
ns=2*n-1;
T(x,y)=T(x,y)+(sin(ns*((pi*x)/a))/ns).*(sinh(ns*((pi*y)/a))/sinh((ns*(pi*b)/a)));
end
T(x,y)=T(x,y)*((4*T1)/pi)
end
end
Antworten (1)
You should follow something like this:
a = 5 ; b = 4 ;
T1 = 80 ;
m = 100 ; n = 100 ;
x = linspace(0,a,m) ;
y = linspace(0,b,n) ;
[X,Y] = meshgrid(x,y) ;
T = zeros(m,n) ;
for n = 1:50
T = T+4*T1/pi*(sin((2*n-1)*pi*X/a)/(2*n-1).*sinh((2*n-1)*pi*Y/a)/(sinh((2*n-1)*pi*b/a))) ;
end
pcolor(X,Y,T) ;
shading interp ;
colorbar
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!