From: meng yan on 29 Jan 2010 03:53 I am trying to reverse a 2D lookup table, i.e.I have T=T(a,b), I need to figure out a=a(T,b). Anybody ever tried this before? Any ideas? i.e.a=[1 2 3];b=[3 4 5];T=[1 3 4;4 6 5;2 7 6]; how could I get a as a=[3X3],b=[1X3],T=[1X3]? Thanks!
From: John D'Errico on 29 Jan 2010 07:03 "meng yan" <anoucxy(a)163.com> wrote in message <hju7lf$e34$1(a)fred.mathworks.com>... > > > I am trying to reverse a 2D lookup table, i.e.I have T=T(a,b), I need to figure out > a=a(T,b). Anybody ever tried this before? Any ideas? > i.e.a=[1 2 3];b=[3 4 5];T=[1 3 4;4 6 5;2 7 6]; > how could I get a as a=[3X3],b=[1X3],T=[1X3]? > Thanks! Has anyone ever "tried it before"? Why do I need to have tried something that is not possible in general, or if possible, is trivial to do? Depending upon the shape of the function T(a,b), there may be multiple solutions, so this will not be possible. Even if it is possible because of a strictly monotonic response, then there may be only a limited set of solutions for certain values of T. But for those values of T such the a solution exists, it will be trivial to compute. Simply fix the value of b, and interpolate. WTP? John
From: meng yan on 29 Jan 2010 19:56 "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <hjuipn$bmr$1(a)fred.mathworks.com>... > "meng yan" <anoucxy(a)163.com> wrote in message <hju7lf$e34$1(a)fred.mathworks.com>... > > > > > > I am trying to reverse a 2D lookup table, i.e.I have T=T(a,b), I need to figure out > > a=a(T,b). Anybody ever tried this before? Any ideas? > > i.e.a=[1 2 3];b=[3 4 5];T=[1 3 4;4 6 5;2 7 6]; > > how could I get a as a=[3X3],b=[1X3],T=[1X3]? > > Thanks! > > Has anyone ever "tried it before"? > > Why do I need to have tried something that is not > possible in general, or if possible, is trivial to do? > > Depending upon the shape of the function T(a,b), > there may be multiple solutions, so this will not > be possible. Even if it is possible because of a > strictly monotonic response, then there may be > only a limited set of solutions for certain values of > T. But for those values of T such the a solution > exists, it will be trivial to compute. Simply fix > the value of b, and interpolate. WTP? > > John May be should use others means, the datas of T=T(a,b) are got by inner compute of matlab using Finit Element Analysis ,so I think it cann't simplly get a(a=a(T,b)), but there must have a means to do that . I aways try to use matlab's data process to achieve it ,but all have failed. Who have a good idears ? meng yan
From: John D'Errico on 29 Jan 2010 20:43 "meng yan" <anoucxy(a)163.com> wrote in message <hk0036$c0k$1(a)fred.mathworks.com>... > May be should use others means, the datas of T=T(a,b) are got by inner compute of matlab using Finit Element Analysis ,so I think it cann't simplly get a(a=a(T,b)), but there must have a means to do that . I aways try to use matlab's data process to achieve it ,but all have failed. Who have a good idears ? > meng yan It does not matter how this function has been obtained. If it does not have a simple, single valued behavior, then NOTHING can give you an inverse relationship. "Good ideas" are not sufficient to overcome a mathematical impossibility. And, if that relationship is a well behaved one then I'll be forced to repeat myself - it is then trivial to generate what you wish to see. A simple interpolation using interp1 will suffice to build your table. John
From: ImageAnalyst on 29 Jan 2010 21:45
I don't understand this: a(a=a(T,b)) I don't know what you're trying to get. Are you trying to get a profile or contours or something like that? For example, let's say that T is a 2D array and for a certain row and column, T will have a value. Do you then want to find all rows and column where T = 42 (for example, or some other value)? Something like this code from the help? [X,Y,Z] = peaks(30); surfc(X,Y,Z) colormap hsv axis([-3 3 -3 3 -10 5]) set(gcf, 'Position', get(0,'Screensize')); % Maximize figure. Of maybe you can simply use the find() function, like [rows columns] = find(T == 42) Giving us a better description of what you want will get you better answers. |