Step 1:

Let the cost of onion is $Rs.x$

Let the cost of wheat is $Rs.y$

Let the cost of rice is $Rs.z$

Thus the above given situation can be represented as

$4x+3y+2z=60$

$2x+4y+6z=90$

$6x+2y+3z=70$

$A=\begin{bmatrix}4 & 3 & 2\\2 & 4 & 6\\6 & 2 & 3\end{bmatrix}$

$X=\begin{bmatrix}x\\y\\z\end{bmatrix}$

$B=\begin{bmatrix}60\\90\\70\end{bmatrix}$

$|A|=4(12-12)-3(6-36)+2(4-24)$

$\quad=0+90-40$

$\quad=50\neq 0$

Step 2:

$A_{11}=0$

$A_{12}=30$

$A_{13}=-20$

$A_{21}=-5$

$A_{22}=0$

$A_{23}=10$

$A_{31}=10$

$A_{32}=-20$

$A_{33}=10$

$adj \;A=\begin{bmatrix}0 & -5 & 10\\30 & 0 & -20\\-20 & 10 & 10\end{bmatrix}$

$\Rightarrow X=\large\frac{1}{50}$$\begin{bmatrix}0 & -5 & 10\\30 & 0 & -20\\-20 & 10 & 10\end{bmatrix}\begin{bmatrix}60\\90\\70\end{bmatrix}$

Step 3:

$A^{-1}=\large\frac{1}{|A|}$$adj \;A=\large\frac{1}{50}$$\begin{bmatrix}0 & -5 & 10\\30 & 0 & -20\\-20 & 10 & 10\end{bmatrix}$

$\begin{bmatrix}x\\y\\z\end{bmatrix}=\large\frac{1}{50}$$\begin{bmatrix}0-450+700\\1800+0-1400\\-1200+900+700\end{bmatrix}$

$\quad\;\;=\large\frac{1}{50}$$\begin{bmatrix}250\\400\\400\end{bmatrix}$

$\quad\;\;=\begin{bmatrix}5\\8\\8\end{bmatrix}$

$x=5,y=8,z=8$

Step 4:

Hence the cost of onions is $Rs.5/kg.$

The cost of wheat is $Rs.8/kg.$

The cost of rice is $Rs.8/kg.$