A mixed symbolic and numerical matrix?

How can I create and compute the determinant of a matrix like this:
A=[x,y,1;1,2,1;3,4,1]. ?In other words a mix of variables and numbers. I declare the variables using syms x y but get an error when attempting to construct this matrix

1 Like

Hey, unfortunately this is a known bug in the way Octave constructs matrices with mixed types.

https://savannah.gnu.org/bugs/?42152

The good news is you can work around this error with something like

A = [x, y, 1; sym(1), 2, 1; sym(3), 4, 1]

or

A = [x, y, 1; sym ([1, 2, 1]); sym ([3, 4, 1])]

Just make sure there is at least one sym in each row of the matrix and the combining operation will work.

That works! Thanks for the help

@bsamuels Oh good man you are asking wonderful problem. Due to you i get answer of this problems. Thanks for asking. :slightly_smiling_face: