Help with 3D plotting
1 次查看(过去 30 天)
显示 更早的评论
I have an assignment to plot a 3D grid showing temperature changes with 3 sides starting at 0 degrees and one side being 80 degrees. The box is supposed to be 5x4 and the temperature change is expressed with a Fourier series.
Right now I'm getting a flat grid with only x and y. I feel like I'm missing something with how I created the Fourier series (specifically T) and obviously with how it's being plotted. I'm not asking for the exact answer, but would appreciate some help with where to go from here:
a = 5; %x length
b = 4; %y length
T1 = 80; %max temp
x = 1:1:5;
y = 0:1:4;
[X Y] = meshgrid(x,y);
for n=1:50
A = sin(2*n-1)*(pi*X/a); %first part of Fourier
B = sinh(2*n-1)*(pi*Y/a); %second part of Fourier
C = (2*n-1)*sinh((2*n-1)*(pi*b/a)); %denomenator of Fourier
Z = (A*B/C);
end
T(x,y) = (4*T1/pi)*Z ; %adding the (x,y) gives me an error but was told that is how it should be written
surf(X,Y,Z)
grid on
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!