How to construct this matrix without loop?
1 次查看(过去 30 天)
显示 更早的评论
采纳的回答
更多回答(1 个)
Azzi Abdelmalek
2013-10-28
编辑:Azzi Abdelmalek
2013-10-28
Example
x=[2 4 8 12 13 19 20 25]
out=cell2mat(arrayfun(@(ii) x(ii:ii+3),(1:numel(x)-3)','un',0))
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!