Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Distribute the temperature over the terrain matrix from the following equation:

ID: 3632936 • Letter: D

Question

Distribute the temperature over the terrain matrix from the following equation:

T(z): Temperature at height z (the terrain matrix), and zs =99m.

The temperatures T(zs) are stored in a 18262x1 matrix and are daily temperatures from a weather station over a 50 year period. The terrain, z, is a 120x120 matrix with different heights.

I am supposed to distribute the temperature from each dayover every point in the terrain. I think that means that I will end up with a matrix with dimensions 120x120x18262, but matlab says that it is out of memory, and I can only get it to calulate the first 2000 days. This is really inconvenient, because I'm supposed to use the T matrix in later problems. This makes me think that I'm doing something wrong. This is a beginner's course in programming, so it should be easy.

It was my professor who told me that it was correct to write T(i,j,k), so that all the values are stored in the T matrix. Is my computer low on memory, or am I doing something wrong here? My code is given below. Thanks!!

Explanation / Answer

yo, try to add this code before the for loop: T = zeros(120,120,18262) This is to prevent MATLAB from constantly resizing the T matrix, which is wasting of resources. hope it helps =)