How do I print the full result of a matrix multiplication in a Maple for loop?

278 Views Asked by At

How do I print the full result without the u1, u2, … variables using a for loop? I tried declaring my two matrix this way:

Capture 1

Capture 2

It executes my for loop until u11 but doesn’t return the vector Then I tried to change my multiplication for a multiply

Capture 3

It also does the for loop completely but doesn’t print the vector like u1 in the last example. Then I tried declaring my two matrixes with an array:

Capture 4

Capture 5

It does the for completely but doesn’t print the vectors like u1 I change my multiplication for A.u[i] but it ain’t working either Then I tried to declare the matrix with Matrix and the vector with Vector

Capture 6

Capture 7

It doesn’t work….

It’s always the first vector u1 that prints correctly and the others aren’t doing the multiplication

1

There are 1 best solutions below

1
On BEST ANSWER

I believe that your problem is that you are not using the correct syntax for assigning a result to a name.

Inside you loops, you have statements like this,

u[i+1] = A.u[i];

Such a statement constructs an equation, and does nothing else with it. Nothing is being assigned here.

What you seem to have expected was actual assignment that a statement like this would accomplish,

u[i+1] := A.u[i];