HP Forums

Full Version: Apply function to elements of a matrix column
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Replace column 5, element by element, with its absolute value:


desired result:


This has been my best success, but is there a simpler way to apply a function to the elements of a column (or row)?:



Works in CAS.

Sorry to annoy you again. I try really hard to get used to my calculator. It is only there are weeks or mounths when I don't have time because of work and family.

I asked about cas in home in an other thread. To be honest I am not fully satified with the answer or to say the facts, but that is not the point here.

But what is going on here, again? I learned that home is for numerial stuff and cas for anything with undefined vars involved. That is in a way annoying when you find out you have to switch, but why would the abs command behave totally different in cas and in home??? Is it that I should use cas for numerical marix (manipulation)? I'm anxious about further posts!
(08-30-2015 09:06 PM)roadrunner Wrote: [ -> ]M0(-5):=abs(M0(-5))

Works in CAS.


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.


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.
Quote:This format can result in "Error: Bad argument type,"
I also noticed that. I probably should have mentioned that I had to type it in each time, copy and paste or getting ABS from the toolbox didn't work.
(08-31-2015 08:26 AM)leprechaun Wrote: [ -> ]I try really hard to get used to my calculator. It is only there are weeks or mounths when I don't have time because of work and family

My sentiments, exactly. Smile
Reference URL's