I have to take product of three matrices Q = Nn.P1.M in the attached code where M = M2.M3.M4...............Mn I would like to know whether the logic is correct. The output is not what I expected. I am attaching the file to retain the indentation. Thanks in advance