surf won't display zeros in the last row?
Ältere Kommentare anzeigen
I wanted to visualize binary vectors (of length 15) in black and white, so I wrote the following code to utilize surf:
vector = ones(1,15);
black = [1,5,14,15];
vector(black) = zeros(1,length(black));
fig_handle = figure;
surf([vector; vector]')
axis([1,2,1,16])
set(gca,'XTick',[])
set(gca,'XTickLabel',[])
set(gca,'YTick',[2,4,6,8,10,12,14])
set(gca,'YTickLabel',{'2','4','6','8','10','12','14'})
caxis([0 1])
colormap gray
view(0,270)
It works exactly as I want as long as "black" doesn't contain 15. When it does, no matter what I try, the fifteenth entry in the image remains white.
Suggestions? Thanks.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Lighting, Transparency, and Shading finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!