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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Can a vector have arguments in its definition

regcurry
14-Alexandrite

Can a vector have arguments in its definition

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

Reg
1 ACCEPTED SOLUTION

Accepted Solutions

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

 

View solution in original post

6 REPLIES 6
LucMeekes
23-Emerald III
(To:regcurry)

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

regcurry
14-Alexandrite
(To:LucMeekes)

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

 

Please explain with example.  Thanks 

Reg
regcurry
14-Alexandrite
(To:LucMeekes)

Sorry, didn’t see the example on my iPad...needed to scroll down.

Reg
regcurry
14-Alexandrite
(To:LucMeekes)

Thanks Luc for the help.  I also recalled this method form Quick Sheets in an old MATHCAD 6.  It works as a function definition.

 

Thanks again.

Reg

Reg

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

 

regcurry
14-Alexandrite
(To:Werner_E)

Werner,

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

 

Thanks again.

Reg
Top Tags