Skip to main content
16-Pearl
March 5, 2019
Solved

Can a vector have arguments in its definition

  • March 5, 2019
  • 6 replies
  • 2214 views

Attached are two Mathcad 15 M050 files.  The Test_SUBROUTINE worksheet works; however, Test_FUNCTION worksheet does not work.  I assume it is because a vector cannot have arguments?  I really want to use the Test_Function worksheet as a reference sheet in other programs.  Any help is appreciated.

Reg

Best answer by Werner_E

You cannot use range variables inside a program like you do on worksheet level.

You have to use for-loops instead.

This small modification makes your function PPD work as you expected:

B.png

 

6 replies

23-Emerald IV
March 5, 2019

A vector is not a function, so you cannot associate parameters to it. But you can define a function (with parameters) that results in a vector.

LM_20190305_Vectorfunction.png

I see you're trying to create a function that does something similar to the built-in logspace() function...

That wasn't available in Mathcad 11, so long a go I created my own version, which accepts units:

LM_20190305_Decade.png

 

It's attached. If you can't use logspace() and still want to create your own function, you can use and/or adapt my function.

 

Success!

Luc

regcurry16-PearlAuthor
16-Pearl
March 5, 2019

“But you can define a function (with parameters) that results in a vector.”

 

Please explain with example.  Thanks 

Werner_E25-Diamond IAnswer
25-Diamond I
March 6, 2019

You cannot use range variables inside a program like you do on worksheet level.

You have to use for-loops instead.

This small modification makes your function PPD work as you expected:

B.png

 

regcurry16-PearlAuthor
16-Pearl
March 6, 2019

Werner,

Thanks much.  I thought I had done that in one of my trials...apparently not. 🤔😩

 

Thanks again.