-1

基本上我有一个 <96x659 double> 矩阵,我想提取第 1 列和第 2 列,然后是第 8 列和第 9 列,然后是第 15 列和第 16 列等等。所以我希望每 2 列分步为 6 。我希望我足够清楚。我是 matlab 的新手。提前致谢!

4

2 回答 2

4

您真正需要做的就是构建所需的列列表:

columns = [1:7:size(matrix,2)+1,  2:7:size(matrix,2)+1];
submat = matrix(:, columns);

请记住,这不一定会按您想要的顺序返回列。如果您希望列按升序排列,您可以替换

submat = matrix(:, sort(columns));
于 2012-11-08T22:31:14.290 回答
0

Matlab Summary and Tutorial

This is a pretty decent introduction, if the Matlab documentation itself appears to be a little dense. Go through the examples, try them out.

于 2012-11-09T12:00:53.740 回答