我怎样才能将MATLAB中的矢量转换为这种特定类型的矩阵?列数将是一个参数。
您可以构建(一劳永逸)带索引的矩阵(第一列为1:L,第一行为1:K等),然后根据这些索引从数据向量中进行选择
% matrix containing the indices
indices = bsxfun(@plus,(0:L-1)',(0:K-1)) + 1; % L-by-K matrix
% now get the data from the vector, based on the indices
X=x(indices);