Matlab - 划分矩阵
可能的重复:
如何划分/在两个其他矩阵之间按行分割矩阵?
我有一个有 100 行的矩阵 A,我想将其随机划分为 2 个矩阵,一个矩阵包含 A 的 70 行,另一个矩阵包含将有剩余的 30 行。这是怎么做到的?
Possible Duplicate:
How can I divide/split up a matrix by rows between two other matrices?
I have a matrix A with 100 rows, I want to randomly partition it into 2 matrices, one that will have 70 of the rows of A, and the other that will have the remaining 30 rows. How is this done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我真正使用 Matlab 已经有一段时间了,但这应该可以工作:
首先,我们寻找一个随机数来分割矩阵。
然后我们将直到这个因子的所有行存储在 B 中,其余的存储在 C 中
Its quite some time that I really used Matlab, but this should work:
At first we look for a random number to split the matrix.
Then we store all rows up to this factor in B, the rest is stored in C