I am dealing with some equation set to calculate coefficients b. The equation set is as below. The x y z are the inputs. b is output.
syms x [4 1]syms y [4 1]syms z [4 1]b = zeros(4,1);b(1) = y3*z2 - y2*z3 + y2*z4 - y4*z2 - y3*z4 + y4*z3;b(2) = y1*z3 - y3*z1 - y1*z4 + y4*z1 + y3*z4 - y4*z3;b(3) = y2*z1 - y1*z2 + y1*z4 - y4*z1 - y2*z4 + y4*z2;b(4) = y1*z2 - y2*z1 - y1*z3 + y3*z1 + y2*z3 - y3*z2;
The equation set would be calculation many times. It takes long time. I want to speed it up. I would like to rewrite this equation set into matrix multiplication, like b = A*[x,y,z] . So I could calculate the vector b in one time , not 4 times. Is it possible? I think this may need some math mind, I have not figure it out. Please help me.
I also try to use subs function. But it is very slow.
Best Answer