2014-01-16 117 views

回答

2

沿着這些路線試試:

cube A = randu<cube>(5,4,3); 

// method 1: 
A.reshape(5*4, 3, 1); 
mat B = A.slice(0); 

// method 2: 
mat C = reshape(mat(A.memptr(), A.n_elem, 1, false), 5*4, 3); 
+0

謝謝,第二個方法效果! – user2966224