palette and index changes
3 次查看(过去 30 天)
显示 更早的评论
Palette=
0
1
2
3
4
5
6
7
Swapping is done in palette
k=1 2 3 4 5 6 7 8
l=4 8 1 1 1 1 4 4
This is the to swap the position
This is my changed Palette
3
7
0
0
0
0
3
3
This palette changes my index matrix also.. index matrix 2185x1575
for example 0 will be replaced by 3 and 3 to 0
Palette affect the index matix also
Pls anyone help me
8 个评论
Azzi Abdelmalek
2013-10-25
How your C matrix is affected? Please to make your question clear, edit your question, don't just add a comment. And you can also post the expected result for
k=1
l=4
The new Palette and the new C
We are not supposed to guess what is in your mind
回答(1 个)
Azzi Abdelmalek
2013-10-25
Palette=0:8;
idx=1:numel(Palette);
k=[1 2 3 4 5 6 7 8];
l=[4 8 1 1 1 1 4 4];
for ii=1:numel(k)
a=Palette(k(ii));
Palette(k(ii))=Palette(k(ii));
Palette(l(ii))=a;
i1=idx(k(ii));
idx(k(ii))=idx(l(ii));
idx(l(ii))=i1;
end
disp(idx)
disp(Palette)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Distribution Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!