I have the following 3 dimensional data in MATLAB:
tau = [6e-9 30e-12 6e-9 30e-12];
E=[1e-3 50e-6 .01 1e-3];
k=[6.93774E-08 1.23666E-08 4.45261E-08 1.90789E-08];
plot3(tau, E, k,'*'); xlabel('tau (s)'); ylabel('Energy (J)'); zlabel('k');
You can see the plot looks like this:
How do you find the equation of the plane that approximates this data (i.e. k is a function of tau and E, so I'm looking for a formula for k(tau,E) = that best fits the data in least squares sense.).
Is there an easy way to do this in MATLAB?
You can do a simple least squares solution: