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

댓글 수: 1

Thank you very much for your respod. this code is working properlly.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

질문:

2021년 11월 6일

댓글:

2021년 11월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by