Plot min values of one matrix on contour of another
1 view (last 30 days)
I have two matrices that are each made as functions of the same two variables. So say they are A(x,y) and B(x,y). I don't know the actual functions; I just have the matrices. Apologies, but I cannot provide my data and I'm not savvy enough to create something representative, but they look like this:
I'm trying to figure out how to plot the min(B) (the right plot) on the contour(A) (the left plot). That is, given a value of A, what is the minimum B that achieves it and then plot the (x,y) that correspond to that minimum B on the contour of A. There's a first difficulty of defining curves of constant-ish A since it is defined by regular intervals of x and y, not A. I think I've solved that by finding the indices of A that are equal to A +/- delta, where delta is a small value. Delta is not easily defined, though, because making it smaller reduces the chance of there being multiple x's for a given y or vice versa that satisfy the condition and making it larger yields a more continuous curve to work with. I think another issue is that for many values of A, B is double-valued, and so there may need to be an additional requirement of taking the shortest path, though defining different options could be interesting. For example, starting at the plus on the right plot, the minimum B (right plot again) for a given A (left plot) could move mostly left on B or sort of up and right, I think. Please ask questions if this is not clear. I realize this would be much easier with the data I'm using, but I'm not allowed to share it. Thanks.