HP Forums

Full Version: adding a row to a matrix with variable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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,
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
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
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]
Reference URL's