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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -