Skip to main content
14-Alexandrite
July 24, 2025
Solved

multiplication procedure between two vectors

  • July 24, 2025
  • 2 replies
  • 408 views

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

 

Best answer by terryhendicott

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

2 replies

21-Topaz II
July 24, 2025

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

SFares14-AlexandriteAuthor
14-Alexandrite
July 24, 2025

Thank you, Terry!

25-Diamond I
July 24, 2025

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