Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
行列を変換する必要があります:
X = [1 2; 3 4] X = 1 2 3 4
に
X = [1 2; 1 2; 1 2; 3 4; 3 4; 3 4] X = 1 2 1 2 1 2 3 4 3 4 3 4
任意の行数の行列に対してこの操作を行います。MATLAB でこれを達成するにはどうすればよいですか?
これは、kronを使用してこれを行う簡単で便利な方法です
kron(X,[1 1 1]')
これが生み出す
1 2 1 2 1 2 3 4 3 4 3 4