dividing data into sub-data
3 次查看(过去 30 天)
显示 更早的评论
How can I divide multiple data into 2 submultiple data?
I have those data:
-1 1 1 1
-1 -1 -1 1
-1 1 -1 -1
-1 1 1 -1
-1 1 1 -1
0 个评论
回答(1 个)
Bob Thompson
2019-1-24
A = [-1 1 1 1; -1 -1 -1 1; -1 1 -1 -1; -1 1 1 -1; -1 1 1 -1];
B = A(:,1:2);
C = A(:,3:4);
1 个评论
Bob Thompson
2019-1-24
Creating arrays from portions of a larger array using the index of the larger array will work for most any scenario, you just need to know what kind of indexing you're looking for. If you could elaborate more on what kind of separation you are looking to perform I could give a more comprehensive answer.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!