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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Can a vector have arguments in its definition

regcurry
16-Pearl

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
ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:regcurry)

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

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

 

Please explain with example.  Thanks 

Reg

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

Reg

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
Werner_E
25-Diamond I
(To:regcurry)

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

 

Werner,

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

 

Thanks again.

Reg
Announcements

Top Tags