I am trying to use a function in Matlab which will give me the following equation:

![enter image description here](https://i.stack.imgur.com/YIa9H.gif)

The `x` and `a` values are in two matrices. I have tried almost everything, but cannot get the correct answer. Anyone who can help??

Thanks