Hello, I have two lists containing numerical data. I want to create a function by assigning all of the elements of one list as arguments of this function and respectively all of the elements of the second list as values of that function. Let's say list A is {0,4,7,8} and list B is {1,4,5,3}. I want a function that for x=0 has y=1, for x=4 y=4, for x=7 y=5 and for x=8 y=3. For all other x the function is not defined. How can it be done?
For a broader perspective: those two lists are my experimental data. I am later using that function to calculate mean square error between experimental data and ideal model. Then I use NMinimize function to obtain parameters from the ideal model that fit my experimental data best. This is why I need those lists as a function.Let's say Texp is my function made from lists:
(*Definition of function to be optimized*)
Ksi2=Sum[(Texp[x]-Model)^2,{x,x_max}];
(*optimizing function*)
opt=NMinimize[Re[Ksi2],{parameter_1,parameter_2,parameter_3}];