Hi,
i would like to do the following:
i have a two-dimensional table (see http://pastebin.com/raw.php?i=p7DQrCKT) where i have in the table cells combustion temperatures (Tc) as function of a certain propellant mixture ratio (MR) (varying horizontally in table) and combustion chamber pressure (pc) (varying vertically in table).
what i would like to achieve is to find the MR and pc combination for a given Tc value. An additional catch is that the TC value is most of the time not exactly the same as the TC values in the table hence simple 'find' will not work (also it won't work because i am not interested in the indices); in other words the algorithm should interpolate between the available Tc values in the table and find the location where the desired Tc value would be located and output the corresponding (interpolated) MR and pc values.
The data in the table is such that only one unique MR and pc combination is possible for a given Tc, hence no multiple solutions are possible.
I know when i want to find the Tc value for a given MR and pc, i can use:
mixtureratio = data(1,3:11); pressure = data(3:19,1); specificheat = data(3:19,3:11); [X,Y] = meshgrid(mixtureratio,pressure); Tc = interp2(X,Y,temperature,MR,pc);
where data is the matrix containing the data read from the text file as given in http://pastebin.com/raw.php?i=p7DQrCKT
But now i hence want to achieve the exact opposite and wonder if this can be easily done with some matlab function or someone has a tip how i could address this problem?
thank you in advance for looking at this question! kind regards,
Ruwan
Best Answer