Repeat a vector with increment
古いコメントを表示
Given
vector a = (1:N)'; with N consecutive integers
how to generate
matrix b = [a a+1 a+2 ... a+M]; with M columns, each column incremented by one.
For example
N = 3; M = 3;
a = (1:3)';
b = [(1:3)' (2:4)' (3:5)' (4:6)'];
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Elementary Math についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!