I am confused about something. Whenever I create an $n\times n$ random matrix using Matlab (using the command $A=\mathrm{rand}(n,n)$), I get a square matrix whose entries are all between $0$ and $1$.
Are the entries of a random matrix allowed to be equal to $0$ or $1$?
If you read the manual, it clearly states that the rand function gives entries drawn from the standard uniform distribution on the open interval $(0,1)$. Thus, you will never get $0$ or $1$. Even if the endpoints were included, the probability of getting $0$ or $1$ would be effectively zero.