This equation for a house heating - in particular case can be written with time in hours
$c\cdot\dfrac{d\big(Th\big)}{dt}=ku-\dfrac{(Th-T_0)}r$
$u$ represents the state of the system once its off $=0$ and once its on $=1$ and I have two unknown constants in this equation $c$ and $r$ my question is how can I solve two differential to find two unknown constants and that's by using mat lab .
NOTE: I am assuming that $c,k,u, T_0,r $ are constants ie independent of $t$ for this solution, If they are not , my solution will be incorrect.
$c\cdot\dfrac{d\big(Th\big)}{dt}=ku-\dfrac{(Th-T_0)}r$
$\dfrac{d(Th)}{dt} = \frac kc\cdot u - \frac{Th}r-\frac{T_0}r$
$\dfrac{d(Th)}{dt}+\frac{Th}r = \frac{ku}c-\frac{T_0}r$
Integrating factor = $e^{\int\frac 1r\,dt}=e^{\frac tr}$
$Th \cdot e^{\frac tr}=\displaystyle\int\bigg[\frac{ku}c-\frac{T_0}r\bigg]e^{\frac tr}\,dt $
$Th\cdot e^{\frac tr}=\bigg[\frac{ku}c-\frac{T_0}r\bigg]\displaystyle\int e^{\frac tr}\,dt$
$Th\cdot e^{\frac tr} =\bigg[\frac{ku}c-\frac{T_0}r\bigg]\cdot e^{\frac tr} \cdot\frac1{r}+C$
$Th = \bigg[\frac{ku}{rc}-\frac{T_0}{r^2}\bigg]+\frac{C}{e^{\frac tr}}$
Use values of $Th,k,c,u,T_0,r$ in the above to find $C$ and then you can plug in the known quantities to find the unknown.
Hope this is what you meant by the question.