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 = [randn(30,1); 5+randn(30,1)];
它有 60 行。如何在不影响密度的情况下减少行数?
使用 reshape 函数更改矩阵的尺寸而不更改内容:
x=reshape(x,m,n)
产生一个 mxn 矩阵。条目数不得更改,因此在您的情况下 m*n 必须等于 60。