HP Forums
adding a row to a matrix with variable - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: adding a row to a matrix with variable (/thread-1712.html)



adding a row to a matrix with variable - Rich - 06-25-2014 06:48 PM

Hi,

Is it possible to add a row to a matrix that has a variable in it?

I am able to add a row to a 2x2 matrix using this

addrow(a1,[1,3],2) resulting in [[0,0],[1,3]]

If i add a variable to to the line (example below) it gives me a "Error bad argument type"? I am trying to set the variable as a real or integer, but I am still getting the same results.

addrow(a1,[1,k],2) resulting in "Error: Bad argument type"

EDIT:: Initially a1:=[[0,0]]

Thank you,


RE: adding a row to a matrix with variable - cyrille de brébisson - 06-26-2014 05:49 AM

Hello,

you might be able to do somehting like that in CAS mode, but not in home/program which are numerical and to not support symbolic matrices.

cyrille


RE: adding a row to a matrix with variable - Jsather - 06-26-2014 03:08 PM

Off topic but related: Why is the row/col number in ADDROW and ADDCOL not optional? I'm sure 100% of us assume if you left it out, the prime would just append the specified row or column on the end. As it is, absence of row/col number generates a syntax error.

This would be a low maintenance change, completely backwards compatible, and certainly an improvement. Just hoping the right people notice and deem it worthy of addition to the revision suggestion list. Smile


RE: adding a row to a matrix with variable - Rich - 06-26-2014 04:05 PM

I am not sure, but the xcas documentation also requires a 3 argument function, the third being the row or column number : \

As a side note, the addrow, addcol function, specifically with a variable, doesn't appear to work in CAS. It does work only if the variable is assigned a real value though.

Perhaps there is another way i can do this, sigh, and back to the CAS manual.

[attachment=900]