I have one matrix, A, that is a 1x137 that consists of all of maximum index values of another matrix, B, 137x145.
I am plotting B using "imagesc()" by defining a grid to plot it on like so:
imagesc((xGrid2(1,:,1)),permute(yGrid2(1,1,:), [3 1 2]),((B)))
xGrid2(1,:,1) is a 1x145 matrix that spans from -15.4 to 46.01, and permute(yGrid2(1,1,:), [3 1 2]) is a 137x1 matrix that spans from -4.582 to 53.42.
Now, I want to plot the maximum index values of A onto B but am not sure how to do this. I am able to perform this without defining a grid easily however I want to plot A and B on the defined grid above. If I plot them together without using a user defined grid and save the corresponding x and y values of where the index maximum values lie, I have to perform a scaling factor to correct the x and y coordinates to fit my defined grid.
Thus, how can I go about plotting the maximum index values on a defined grid AND THEN extract the corresponding x and y values of these maximums?
I can use "impixelinfo()" to extract the x and y at each point but that would involve hard coding the coordinates of each point, I would like it to be a bit more automated..
Thanks for the help.