Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello,
I'd like to perform a multiplication procedure between two vectors. I am getting an error. Prime 9 sheet is attached.
Regards,
Sam
Solved! Go to Solution.
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.
or b) adjust ORIGIN=1 for one based indices into vectors and matrices.
Cheers
Terry
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.
or b) adjust ORIGIN=1 for one based indices into vectors and matrices.
Cheers
Terry
Thank you, Terry!
You are on the safe side if you use the system variable "ORIGIN" and the "last" function.
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.
