Skip to main content
14-Alexandrite
Jul 24, 2025 1:05 PM UTC
Solved

multiplication procedure between two vectors

Hello,

I'd like to perform a multiplication procedure between two vectors. I am getting an error. Prime 9 sheet is attached.

 

Regards,

Sam

 

SFares_0-1753362259956.png

 

terryhendicott
21-Topaz II
Jul 24, 2025 1:16 PM UTC

Hi,

Vector indexes are zero base arrays by default.

Two options.

a) Leave origin at zero for zero based arrays and change the indices to zero based.

Capture.JPGCapture2.JPG

or b) adjust ORIGIN=1 for one based indices into vectors and matrices.

Cheers

Terry

3 replies

terryhendicott
21-Topaz II
Jul 24, 2025 1:16 PM UTC

Hi,

Vector indexes are zero base arrays by default.

Two options.

a) Leave origin at zero for zero based arrays and change the indices to zero based.

Capture.JPGCapture2.JPG

or b) adjust ORIGIN=1 for one based indices into vectors and matrices.

Cheers

Terry

Translate
SFares14-AlexandriteAuthor
14-Alexandrite
Jul 24, 2025 1:19 PM UTC

Thank you, Terry!

Translate
Werner_E
25-Diamond I
Jul 24, 2025 2:46 PM UTC

You are on the safe side if you use the system variable "ORIGIN" and the "last" function.

Werner_E_0-1753368320805.png

This way, your calculations are independent of the current value of ORIGIN.

 

You can also dispense with the range variable altogether if you use vectorization. However, “max” is a function that cannot be vectorized, which is why we define an auxiliary function “Max” and then vectorize it.

Werner_E_0-1753368810373.png

 

Translate