cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Translate the entire conversation x

multiplication procedure between two vectors

SFares
14-Alexandrite

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

 

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3

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

SFares
14-Alexandrite
(To:terryhendicott)

Thank you, Terry!

Werner_E
25-Diamond I
(To:SFares)

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

 

Announcements

Top Tags