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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Translate the entire conversation x

Repeat a function and save the results in a vector

ksk_10594232
12-Amethyst

Repeat a function and save the results in a vector

Hi

I have tried to create a program that calculates a function for each value in the vector, but the result is not being saved for each loop. What am I doing wrong? Thanks for your help. 

 

ksk_10594232_0-1742994035931.png

 

ACCEPTED SOLUTION

Accepted Solutions

You just need to change "For" statement to make "i" a real range (not just 3),.

 

rgunwaldsen_0-1742996918043.png

 

View solution in original post

3 REPLIES 3

You just need to change "For" statement to make "i" a real range (not just 3),.

 

rgunwaldsen_0-1742996918043.png

 

Thank you!

You could avoid any programming and loops

Werner_E_0-1743007250531.png

Vectorization (the arrow over the expression) is not mandatory here but I  it good style to use it whenever a scalar calculation is applied to the elements of a vector. In case of your example we sure can see it as a vector calculation and omit vectorisation.

 

Announcements


Top Tags