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
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
[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.
Thanks, John,I got you , it is impossible to got absolutely reverse ,I think i should try other ways. Thank you very much!
Hi,ImageAnalyst,I'm sorry to failed to description it clearly.
the question is : I have a matrix T , two vectors a and b,size(T)=101*181,
size(a)=1*101,size(b)=181*1,so I can use 2-D lookup table blocks to got the value of T depending on the input a and b, the most important question is I don't know the relation between T with a and b,only their datas .so if I want to got the value of a , the input of 2-D lookup table block are T and b, how to achieve it? is it possible?
eg.
a=[1 2 3];b=[4 5 6];T=[1 3 5;2 4 6;3 4 5]; a and b as the inputs of lookup table ,output is the value of T, when inputs is 1 and 4,we can got T=1
what I want to do is: T and b as the inputs of lookup table ,output is the value of a,there still don't know their relation.
can you got my idears?
I'm sorry my writting english is so bad.
thanks!
clc;
close all;
clear all;
workspace; % Display workspace panel.
% Create a 1000 row by 10 column array of
% random integers in the range 0-49.
T = uint8(50*rand(1000, 10));
% Set a column where we'll look for a certain T value.
b = 8;
% Find where T = 42 in this column (column b=8)
aAtTEquals42 = find(T(:,b)==42)
I had tried to use this way,but there is a defualt. I cann't break in points,so this only got some approximate values,you know that 2D lookup table can break in some others values using algorithms ,the real matrix T is more vectors than only T.
when I use the function find(),it only find the values which excist in only T
thanks very much!