On 1/14/2010 8:48:08 PM, adiaz wrote:
== Your functions looks to work fine, free of errors, and with the desired beahvior.
I now believe in Miracles
🙂== It's a full work in the sense that it is very complete and easy in follow the logical implementation of the features.
Thanks. I've added a bonus Matlab function trapz (I don't have Matlab, so I'm just going from their documentation -
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/trapz.html ).
Once again, I've had to make some adjustments to cope with the distinctions between Matlab and Mathcad, including the lack of variable number of arguments in user-defined functions. However, it seems to work - I've even thrown in an example from Mathematica's NIntegrate using the Trapezoidal option.
== Some few comments in green in the attached. Modifications to Reduce are for work in my mathcad 11, but as side effect the recursion was eliminated.
Thanks, Alvaro. I've copied your function into the attached worksheet, retaining your suggestion that -2 serve to act as the lower-case variant does. Would initializing a as 'a
0←0' get round the need to use the submatrix function?
Unfortunately, my M11 machine has a bad case of Gremlins and I can only check M13 (work) and M14 (2nd home PC).== PD: What offuscate (to me) matlab convention is that, even it is well for matrix decomposition opperations, isn't congruent: if vectors are "column vectors", then must to be always like that, and "rows vectores" are not allowed; a row with scalar values must to be a matrix of column vectors with dimension one, but matlab fails in follow their own convention.
Yes, I sometimes get confused. It might be less confusing if Mathcad implemented MDAs.
== Mathcad style, taking matrices as an entity and appliying aggregate functions to the entire structure it's algebraically correct and useful in the practice.
Agreed
=== A second optional argument can make all functions more usual for those cases that it is required take columns as vectors, but then it is not avaible in usual mathcad nonsense requirement that functions can't have variable number of arguments. To cover this case, the value -2 as second argument is equivalent to the more comfortable and readable none second argument.
Yes. I've sometimes had to write several variants of a function, each one taking a different number of arguments.
Stuart