b***k 发帖数: 2673 | 1 sub2ind can get matrix with the following order
1 6 11 16 21
2 7 12 17 22
3 8 13 18 23
4 9 14 19 24
5 10 15 20 25
but any way to get matrix with index in the following order:
1 3 6 10 15
2 5 9 14 19
4 8 13 18 22
7 12 17 21 24
11 16 20 23 25
thanks. |
c*******h 发帖数: 1096 | 2 A = hankel(1:5, 5:9);
ind = sort(A(:));
map(ind) = 1:25;
don't know what exactly you want. but the above three lines give
you a map = [1 2 4 7 11 3 5 ...... ]
【在 b***k 的大作中提到】 : sub2ind can get matrix with the following order : 1 6 11 16 21 : 2 7 12 17 22 : 3 8 13 18 23 : 4 9 14 19 24 : 5 10 15 20 25 : but any way to get matrix with index in the following order: : 1 3 6 10 15 : 2 5 9 14 19 : 4 8 13 18 22
|
j**u 发帖数: 6059 | 3
[~, ind] = sort(A(:)) ;
【在 c*******h 的大作中提到】 : A = hankel(1:5, 5:9); : ind = sort(A(:)); : map(ind) = 1:25; : don't know what exactly you want. but the above three lines give : you a map = [1 2 4 7 11 3 5 ...... ]
|
l********a 发帖数: 1154 | |
c****p 发帖数: 6474 | 5 jpeg里的zigzag是连续的。
这个不连续。
【在 l********a 的大作中提到】 : jpeg, zigzag?
|