
To generate the above pseudocode, I used the following code:
\begin{algorithm}
\caption{sample}\label{sample}
\begin{algorithmic}[1]
\Require $\mathbf{D} \in \mathbb{R}^{M \times N}$
\State $\mathbf{V}^{(0)} \in \mathbb{R}^{K \times N} \gets $ random matrix
\For {$t= 1:T$}
\State $\mathbf{U}^{(t)} \gets Update\mathbf{U}(\mathbf{D},\mathbf{V}^{t-1})$
\State $\mathbf{V}^{(t)} \gets Update\mathbf{V}(\mathbf{D},\mathbf{U}^{t})$
\EndFor
\State \Return $\mathbf{U}^{(T)},\mathbf{V}^{(T)}$
\end{algorithmic}
\end{algorithm}
The problem is I have to use \mathbf for all D,UandV to represent them as matrix or vector. Is there other way to define these variables once and no need to use \mathbf for all?
