Post Reply 
Apply function to elements of a matrix column
08-31-2015, 10:58 AM (This post was last modified: 08-31-2015 11:09 AM by DrD.)
Post: #4
RE: Apply function to elements of a matrix column
(08-30-2015 09:06 PM)roadrunner Wrote:  M0(-5):=abs(M0(-5))

Works in CAS.

Road

This format can result in "Error: Bad argument type," because the command line parser converts M0(-5):=abs(M0(-5)) to M0(-5):=|M0(-5)|. When M0(-5):=abs(M0(-5)) is recalled to the command line via Ans, (or even by copy/paste from the above posting), the command line parser converts from abs() to | |, which fails. I'm sure authors are aware of this potential bug, but negative indices are not supported in CAS at this time. So this inconsistent behavior isn't likely to get fixed soon.

-Dale-

Update Note:

I suppose one could transpose the matrix and apply a function to rows, instead of columns. This idea further complicates what should be a simple process. Working with matrices as a data field, such as when performing Kirchhoff network solutions (my current interest in the subject), makes (transpose - apply row changes - transpose - further processing) not a very pleasant solution.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Apply function to elements of a matrix column - DrD - 08-31-2015 10:58 AM



User(s) browsing this thread: 1 Guest(s)