I want to generate a sequence of n number
1 回表示 (過去 30 日間)
古いコメントを表示
i want to generate a sequence like 1 1, 1 2, 1 3, 2 1, 2 2, 2 3, 3 1, 3 2, 3 3, ...
0 件のコメント
回答 (1 件)
Roger Stafford
2017 年 12 月 23 日
n = 3; % <-- Choose any positive integer n
t = 1:n;
M = [reshape(repmat(t,n,1),[],1),repmat(t',n,1)];
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!