I've been trying to solve a system of linear equations, with some variables being interpolated functions of other variables. I've tried turning these functions into symbolic functions, but that doesn't seem to work. Does anybody have a workaround that doesn't involve curve-fitting the data? I would really like to keep my original dataset for accuracy. My dataset is too large to put the real one in this code example, so I've supplied a placeholder dataset of [0 100],[100 0],[0 100;0 100].
Here is my code:
% Setting up system of equations
syms FD ICE EM GEN
AM = [0 1 1 0 ;
0 1 0 0 ;
0 0 1 0;
0 0 0 1];
Tvec = [FD;ICE;EM;GEN]
eqs= AM * Tvec == Tvec %System of symbolic equations
% Adding the givens to my system of equations
eqs(5) = FD==1;
eqs(6) = ICE==4;
eqs(7) = interp2([0 100],[100 0],[0 100;0 100], ICE,EM) % <-- this is where the problem is.
results=solve(eqs)
ICE
,EM
) into a numeric function (interp2
). What doesn't work? Is there an error? If so, what? Is that answer wrong? If so, what do you expect? – horchler