Skip to main content
1-Visitor
March 13, 2012
Solved

Vector filling problem

  • March 13, 2012
  • 2 replies
  • 3392 views

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

Best answer by MikeArmstrong

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

Mike

2 replies

1-Visitor
March 13, 2012

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

Mike

1-Visitor
March 13, 2012

Why bother with the fuction in the first place?

Mike

Ian11-VisitorAuthor
1-Visitor
March 13, 2012

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 ??

Ian11-VisitorAuthor
1-Visitor
March 13, 2012

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

1-Visitor
March 13, 2012

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

Mike