I have 2 matrices in Matlab, A and B, I am trying to find an easy way to take these in and output a function that maps A to B, it should be as easy as a function in the form of B=Ax+y where x and y are static numbers, but I cannot seem to remember my basic math skills today. Is there an easy way of doing this in Matlab?
I have 2 matrices in Matlab, A and B , I am trying to
Share
Edit
This is the answer to the OP’s original question as explained in the comments.
Take two elements
b1andb2fromBand the same elementsa1anda2fromA. Be sure thata1 ~= a2. If all elements ofAare the same then the problem is trivial. Then computeIf
xandydo not satisfy the equation, thentotal_error > 0and there is no suchxandy.Actually, if x and y are just numbers, you can just do
Matlab is capable of doing matrix times scalar arithmetic by broadcasting the number
xto each element ofA.If
xis a vector andA*xmakes sense, you can do the same.If
yis a scalar or a vector of the same size asA*x, you can also do the same.