MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today
Asked by Jivitesh on 10 Jul 2013

If x and y are 3*3 matrices . then what'll be x(y) ?

*No products are associated with this question.*

Answer by Wayne King on 10 Jul 2013

I'm assuming that is just the composition of the two linear operators, in which case that is matrix multiplication. In other words, the definition of matrix multiplication comes from viewing the two matrices (x and y) as linear operators and composing them.

If it is something more than that, then I think we need more context.

Answer by Jan Simon on 10 Jul 2013

Then `y` contains either linear or logical indices:

x = reshape(1:9, 3, 3); y = x; x(y) % same as x

y = ones(3, 3); x(y) % Repeated first element of x

y = true(3, 3); y(2,2) = false; x(y) % All elements without the central value

y = x + 5; x(y) % ERROR, the linear index must be 0 < index <= numel(x)

## 0 Comments