how to split a column matrix to sub matrix with specific type?

for this I have used nested for loop. still I was not successful. As I am a biginner for matlab I really need lot of help. If anyone can help, Please do this codeing. So far I could not able to find a tutorial for this problem.

 采纳的回答

Let X be your column data and let k be your value.
% Arrange three time steps as moving window
X = rand(10,1) ;
k = 3 ;
idx = bsxfun(@plus, (1 : k), (0 : numel(X) - k).')';
iwant = X(idx)
iwant = 3×8
0.9752 0.1159 0.5926 0.0492 0.0715 0.8189 0.0654 0.8151 0.1159 0.5926 0.0492 0.0715 0.8189 0.0654 0.8151 0.4476 0.5926 0.0492 0.0715 0.8189 0.0654 0.8151 0.4476 0.4254

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by