How to double the size of a matrix and propagate its elements in Matlab?

后端 未结 1 430
不思量自难忘°
不思量自难忘° 2020-12-12 01:17

suppose I have a matrix like this:

a = 
    1    2
    3    4

I want to double the size of matrix and create something like this:



        
相关标签:
1条回答
  • 2020-12-12 01:30

    use kron - Kronecker tensor product:

    kron(a,ones(2))
    
    
    ans =
     1     1     2     2
     1     1     2     2
     3     3     4     4
     3     3     4     4
    
    0 讨论(0)
提交回复
热议问题