Post Reply 
1x1 matrix addrow problem
05-31-2016, 09:44 AM (This post was last modified: 05-31-2016 09:54 AM by std.)
Post: #1
1x1 matrix addrow problem
Hello,
As the title describes I have a problem with 1x1 matrices.

I am writing down some calculation steps to use with my HP Prime for my exams.
In the process, I calculate a matrix with dimensions nx1 (it is a column vector) and I want to add an element somewhere between the elements so that it becomes (n+1)x1.
The "ADDROW" function works ok for matrices 2x1 or larger, but in the special case of 1x1 matrix (a.k.a. element matrix) it does not work and gives an error "Bad Argument Type".

Example:
I have a 3x1 matrix A=transpose([a1 a2 a3]) and I want to add a new element "anew" between a1 and a2 so that it becomes A=transpose([a1 anew a2 a3).
ADDROW(A,[anew],2) works ok
But if I have a 1x1 matrix A=(a1) and I want to add a new element "anew" either before a1 or after a1, so it becomes A=transpose([anew a1]) or A=transpose([a1 anew]) respectively, the ADDROW doesn't work.

I could use "append", but it brings the new element to the end of the vector and the size of the vetror becomes 1x2 (row) not 2x1.

I would like a general formula that would work in any case without having to alternate the calculations steps in order to handle the special case of 1x1.
Any suggestions?
Thanks
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
1x1 matrix addrow problem - std - 05-31-2016 09:44 AM
RE: 1x1 matrix addrow problem - DrD - 05-31-2016, 11:02 AM
RE: 1x1 matrix addrow problem - std - 05-31-2016, 11:52 AM
RE: 1x1 matrix addrow problem - DrD - 05-31-2016, 03:12 PM
RE: 1x1 matrix addrow problem - std - 06-01-2016, 05:04 PM



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