# A matrix with some cases for its entries [duplicate]

I'm beginner in Mathematica.

I have a $3 \times 3$ matrix, say $A$, in which some of its entries are nonzero (I know which entries are nonzero); for example the entries $a_{12}$, $a_{13}$, $a_{21}$, $a_{23}$ and $a_{31}$. But the nonzero entries can have 3 different values, say $x,y$ and $z$. I want to see determinant of $A$ in all these different cases. How can I do that?

Few months age I asked this question but in an ambiguous way, so I couldn't get the answer.

Bests,

## marked as duplicate by Henrik Schumacher, m_goldberg, rhermans, kglr, Mr.Wizard♦May 31 '18 at 9:38

• yeah, but that time my question was ambiguous and I couldn't get the answer. – A. Mpi May 31 '18 at 6:57
• But that time, you accepted an answer. – Henrik Schumacher May 31 '18 at 7:00
• Maybe. but it doesn't work now – A. Mpi May 31 '18 at 7:05
• If instead of this discussions you answered me, everything was finished Henrik – A. Mpi May 31 '18 at 7:06
• @A.Mpi wait.... "If instead of this discussions you answered me, everything was finished Henrik – A. Mpi" With such rude comments you expect to inspire anybody to volunteer their time to look at your problem? Your question will be put on-hold because it may be considered a duplicate. You can edit your question if you consider this is a mistake and give great emphasis in what was NOT answered in the other question. – rhermans May 31 '18 at 8:21

Maybe you simply require something like the following?

myarr = (Array[a, {3, 3}] /. Thread[{a[1, 1], a[2, 3], a[3, 2]} ->  0]);
Det[myarr]


a[1, 3] a[2, 2] a[3, 1] - a[1, 2] a[2, 1] a[3, 3]

nonzero1 = Thread[{a[1, 2], a[1, 3], a[2, 1], a[2, 2], a[3, 1], a[3, 3]} ->
{1, 4, 6, 8, 100, 3}];
nonzero2 = Thread[{a[1, 2], a[1, 3], a[2, 1], a[2, 2], a[3, 1], a[3, 3]} -> Range[6]];
nonzero3 = Thread[{a[1, 2], a[1, 3], a[2, 1], a[2, 2], a[3, 1], a[3, 3]} -> RandomReal[1, 6]];


Det[myarr] /. nonzero1
Det[myarr] /. nonzero2
Det[myarr] /. nonzero3


-3218

-58

-0.168692