Matrix Multiplication for n*n matrix

Posted by ansarise on 26-Jul-2011 11:29

Am a beginner , please help me to finish this task .

Already wrote some code but not getting.

DEFINE VARIABLE m AS INTEGER EXTENT 10.
DEFINE VARIABLE n AS INTEGER EXTENT  10.
DEFINE VARIABLE  mul AS INTEGER EXTENT 10.
DEFINE VARIABLE i AS INTEGER INITIAL 1.
DEFINE VARIABLE s AS INTEGER INITIAL  1.
DEFINE VARIABLE j  AS INTEGER INITIAL 1.
DEFINE VARIABLE X1 AS INTEGER INITIAL 1.
DEFINE VARIABLE a AS INTEGER INITIAL  0.
DEFINE VARIABLE k  AS INTEGER INITIAL 1.
DO i = 1 TO 9:
    SET m[i].
END.
DO j = 1 TO 9:
    SET n[j].
END.
ASSIGN i = 1.
ASSIGN j = 1.
DO  WHILE X1 = 3:
DO WHILE i = 3:
DO WHILE j = 3:
    mul[s] = m[j + a * (x1 - 1)] + n[k].
    k = k + 1.
END.
END.
k = 1.
a = 3.
END.
ASSIGN i = 1. 
DO i = 1 TO 9:
    MESSAGE mul[i]
        VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.

All Replies

Posted by dfranken on 28-Jul-2011 10:05

What are you exactly trying to do?

Matrices have two dimensions, not one, otherwise you're using vertices instead.

Besides that, I don't think your DO-loop is working correctly, because X1 = inited to 1, not 3, as are i and j.

This thread is closed