Copper plate temperature distribution using averaging of grid points. Please help!

2 views (last 30 days)
I'm struggling to get past the second of ten parts of my assignment. The question starts with:
A square copper plate is surrounded on three sides by an ice cold bath (temperature 0oC) and a constant temperature of 100 oC is maintained on the fourth side.
I solved the first question ((i) Create a 100x100 grid on the copper plate.) by using:
clear all X = ndgrid(1:100, 1:100);
I can't get the second question right
(ii) Assuming an initial temperature of 0oC throughout the copper plate, loop over the grid-points, computing an updated temperature at each internal grid point using the following equation for the temperature at grid-point (i,j): T(i,j)=0.25(T(i+1,j)+T(i-1,j)+T(i,j+1)+T(i,j-1)
I input:
Tinitial=0 i=1 j=1 T(i,j)=0.25*(T(i+1,j)+T(i-1,j)+T(i,j+1)+T(i,j-1))
I got the following error message: Error in Ass7b (line 7) T(i,j)=0.25*(T(i+1,j)+T(i-1,j)+T(i,j+1)+T(i,j-1))

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!