Skip to main content
1-Visitor
September 13, 2016
Question

Creating A Vector of Functions - Possible?

  • September 13, 2016
  • 2 replies
  • 5704 views

I am somewhat new to Mathcad and I was wondering if this was possible to do.

I basically want to create a vector with stored functions.

See the attached mathcad v15 file with comments.

Thanks in advance for your comments!

2 replies

23-Emerald I
September 13, 2016
1-Visitor
September 13, 2016

Fred's solution is obviously more concise.  However, to use an approach more similar to what you had attempted:

aguter1-VisitorAuthor
1-Visitor
September 13, 2016

Thanks Mark.

Still kinda new to the programming of MathCAD.

Within the for loop, is the name "result" meaningless unless used in the for loop again?

Also would you mind explaining what is wrong in my syntax/what MathCAD is interpreting my input as in the file I uploaded?

1-Visitor
September 13, 2016

Austin,

Yes, the variable "Result" could be anything you want.  The main difference is that it's a variable, and not a function.  To make the program even more similar to what you had proposed, you could use the variable "PLF" and just get rid of the "(x)" in the two "if" lines.  However, the other difference is that the last line of your program must be the entirety of what you want the result to be.  If you left out the last line of my code, PLF(x) would just return a single value: Result[LastRow.