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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Prime 8: Input Vector to For Loop, Get Scalar Back, but Want Vector

DM_10425296
3-Newcomer

Prime 8: Input Vector to For Loop, Get Scalar Back, but Want Vector

Hello, I am inputting a vector into a for loop, but struggling to get a vector back for the output.  I would appreciate any help.  I could not figure it out from other examples on this forum.  I am wondering if I am making an error in the initial step of the for loop? 

 

Thank you.

ACCEPTED SOLUTION

Accepted Solutions

DJNewman_0-1707258328916.png

 

Here's what Luc is saying put into practice. You don't need a program, you can just have a vectorised function definition.

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.

View solution in original post

3 REPLIES 3
LucMeekes
23-Emerald III
(To:DM_10425296)

1. You should attach your Prime Worksheet.

2. Your program for delta.x uses i in the for loop, but you are not using i in the index of the vector. This means your program does not create a vector.

3. I think that if you vectorise the expression after 

delta :=

Then delta will be the vector you are looking for, and you don't even need the program for delta.x

 

Success!

Luc

DJNewman_0-1707258328916.png

 

Here's what Luc is saying put into practice. You don't need a program, you can just have a vectorised function definition.

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.

DJNewman and Luc, thank you so much!  DJ, I appreciate you putting up the image.  Sorry for not including the worksheet, I will definitely do so in the future!

Announcements

Top Tags