Community Tip - You can change your system assigned username to something more personal in your community settings. X
I've attached a snapshot of the Mathcad sheet where I'm working. I need some guidance on how to use the minimum and maximum functions in Mathcad to obtain the FTMF values.
Is the below of any help?
Range vectors are useful, but it is generally better to work with vectors. Your F (which I've renamed vec) is a common user-defined function that converts ranges and matrices into vectors. You'll find it called rng2vec, amongst other things, but the operation of converting matrices into vectors already has the name vec, and it's merely been given an additional Mathcad-specific task.
Stuart
Instead of creating a range j and then converting it to a vector you could create the vector of angles right ahead.
As Stuart I assumed that you meant the angles to be in degree and added that (pseudo) unit.
Note that Prime assumes angles to be in radiant and also displays angles in radiants unless otherwise told by adding the unit 'deg'.
Vectorization when creating the FTMF vector is not mandatory in your case but this depends on the calculations used and so you are always on the safe side if you apply explicit vectorization when you feed a vector into a scalar function.
Prime 10 sheet attached
I have a set of functions to handle the commonplace tasks of converting range variables to vectors and/or creating additional range variables that will index into vectors or alongside non-integral range variables. I usually keep them in a (collapsed) Area in my default worksheet.
The built-in function format shows a range as a string comprised of either "start..stop" or "start, next..stop" ... but only if it is on the right-hand side of a definition. If it's on the left-hand side, then Mathcad will iterate through format's argument and apply format to each value in the ranges' sequence.
Stuart
Its a really pity that a user-defined function vec`() can't be used the most natural way which would be something like
Instead we have to define a temporary range variable and must take care how to use it
Indeed. There is a bit of a palaver involved in using range operators as arguments to vec or any other function.
Unfortunately, my IsRange function ended up being one of exclusion because one of the standard tests for rangehood (ie, transposition) doesn't work with vec's output.
Stuart
Yeah, ranges are beasts!
But I am not sure if SMath's way to handle ranges and vectors the same should be the direction to go.
@Werner_E wrote:
Yeah, ranges are beasts!
But I am not sure if SMath's way to handle ranges and vectors the same should be the direction to go.
Oh, I don't know. It could be amusing.
However, the use of ranges (and maybe vectors) for array subscripting is something I'd definitely like to see.
Indeed, I might very well have requested this capability long ago, back when Sophie and her fellow Stegosaurus stenops were muttering darkly about this new-fangled programming lark Mathcad 7 had foisted upon the Tithonian age, "It'll never catch on", she thought, as she munched on some mossy cycads, paying little heed to the insects madly dashing to escape her ravenous maw, and idly wafting her thagomizer through the air. "Hah. Wait until you see what I can do now!", mused a passing Allosaur, "If only there was an IsRange function and the ability to use ranges as array index subranges.".
But after all those years learning to deal with the range's, I think I'd feel rather let down by new users not going through the Range Variable Rite of Initiation.
And I'm not sure what the trade offs are for such notation.
Stuart