From: Adam Reichert [support@mathworks.com] Sent: Thursday, August 09, 2012 8:48 AM To: magene@mbari.org Subject: RE: Terms in reference matrices Hello Eugene, I noted that there was a mistake in my listing of the meanings of the elements of R. It should read R(1,1): Change in the x-coordinate when increasing rows R(2,1): Change in the x-coordinate when increasing column R(1,2): Change in the y-coordinate when increasing row R(2,2): Change in the y-coordinate when increasing column R(3,1) and R(3,2): Necessary offsets. Please tell me if you have any more questions. Please preserve the THREAD ID below in any further correspondence on this query. This will allow our systems to automatically assign your reply to the appropriate Service Request. If you have a new technical support question, please submit a new request here: http://www.mathworks.com/contact_TS.html. Sincerely, Adam Reichert Application Support Engineer Technical Support Department MathWorks Phone: (508) 647-7000 option 2 Self-Service: http://www.mathworks.com/support File Exchange and Newsgroup Access: http://www.mathworks.com/matlabcentral/ [THREAD ID:1-J7QLWE] -----Original Message----- From: AdamReichert_Support Sent: 2012-08-09 11:18:23 AM To: magene@mbari.org Subject: Terms in reference matrices Hello Eugene, I am writing in reference to your Service Request # 1-J7QLPE regarding 'Terms in reference matrices'. Thank you for your question. As this is a new topic, I have created a new service request. Consider the output of ARCGRIDREAD: [Z,R] = arcgridread('MtWashington-ft.grd'); The matrix 'Z' gives the values of altitude at a set of locations that are spaces in a grid. The data in Z(r,c) corresponds to the (x,y)-locations given by the following formula x = d*r + e*c + f y = u*r + v*c+ w Please note: * R stores the coefficients in the above formula. This can be organized into a matrix computation: [x y] = [r c 1] * [d u;e v; f w] [x y] = [r c 1] * R * The formula also explains what each term means R(1,1): Change in the x-coordinate when increasing rows R(2,1): Change in the x-coordinate when increasing column R(1,2): Change in the y-corrdinate when increasing column R(2,2): Change in the y-corrdinate when increasing column R(3,1) and R(3,2): Necessary offsets. I the example above R has the following value R = 0 -30 30 0 310365 4916055 This means that the y-location decreases by 30 meters when the row increases and the yx-location increases by 30 meters when the column increases. This type of spacing corresponds the mental image many people have of the matrix 'Z' as a table that starts at the top of the page. Rows correspond to x- coordinate, and columns correspond to y-coordinates. Moving down from row 1 to row 2 corresponds to decreasing y-coordinates, which is why the sign of R(1,2) is negative. This is touched upon briefly in the documentation page for MAKEREFMAT: -- To achieve the most typical kind of alignment, where x increases from column to column and y decreases from row to row, make dx positive and dy negative. In order to specify such an alignment along with square pixels, make dx positive and make dy equal to -dx: R = makerefmat(x11, y11, dx, -dx) -- Finally, In the above examples I used a reference matrix to map for a data in which locations are specified in meters. The above would also hold in cases where latitude and longitude are used instead. Replace "x" with longitude and "y" with latitude. I have submitted a request for enhanced documentation that describes each term in the reference matrix. The developers will consider its inclusion in a future release. Please tell me if you have any questions. Please preserve the THREAD ID below in any further correspondence on this query. This will allow our systems to automatically assign your reply to the appropriate Service Request. If you have a new technical support question, please submit a new request here: http://www.mathworks.com/contact_TS.html. Sincerely, Adam Reichert Application Support Engineer Technical Support Department MathWorks Phone: (508) 647-7000 option 2 Self-Service: http://www.mathworks.com/support File Exchange and Newsgroup Access: http://www.mathworks.com/matlabcentral/ [THREAD ID: 1-J7QLPE]