matlab - Find k for this matrix multiplication -
i have these 3 matrices:
a = [4 1 0;6 k 4], b = [-2 -1;3 1;-2 4], ab = [-5 -3;-20 10]
i want know how can use matlab find k, if ab = * b
.
i tried this:
fsolve(@(x) mtimes([4 1 0;6 x 4],[-2 -1;3 1;-2 4]),[-5 -3;-20 10]);
but did not work out. ideas how can this?
the trick here define k symbolic variable, , use solve
solve equality defined. you'll notice looking @ a*b
solution should 0.
syms k = [4 1 0;6 k 4]; b = [-2 -1;3 1;-2 4]; ab = [-5 -3;-20 10]; a*b solve(a*b==ab)
Comments
Post a Comment