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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Vector filling problem

Ian1
1-Newbie

Vector filling problem

Heres a little MathCad 15 problem I would welcome some help with - I have spent a couple of days trying to get a MonteCarlo sim to work and have traced the problem to a simple vector filling function

If I pass numbers to a function to put into a vector - the fourth element in the vector becomes a {4,1} sub vector containing the first 3 elements plus a zero. Problem is reproducable and occurs on 64 bit Win 7 and 32 bit XP machines

I have attached a very short worksheet that illustrates the problem

Any thoughts anyone

Ian

1 ACCEPTED SOLUTION

Accepted Solutions
MikeArmstrong
5-Regular Member
(To:Ian1)

Have a look at the attached. You are using d as a argument and then calling it inside the program.

Mike

View solution in original post

6 REPLIES 6
MikeArmstrong
5-Regular Member
(To:Ian1)

Have a look at the attached. You are using d as a argument and then calling it inside the program.

Mike

Why bother with the fuction in the first place?

Mike

Why bother with the fuction in the first place?

The Montecarlo funtion needs a function with a vector input - not a list of variables seperated with commas, so I was just tucking all the parameters into a vector - or have I got that wrong too ??

MikeArmstrong
5-Regular Member
(To:Ian1)

You could simple use the function as shown in this worksheet. Vec has been defined in the collasped area.

Mike

Ian1
1-Newbie
(To:Ian1)

Mike

Thanks - I have been using MCad for more years than I can remember - I can't believe I made such an elementary mistake and struggled to solve it for almost a day ! Not seeing the wood for the trees.

Thank you for a clear pair of eyes !

Ian

MikeArmstrong
5-Regular Member
(To:Ian1)

No problem at all. Sometimes it is much harder to find your own mistakes.

Mike

Top Tags