필터 지우기
필터 지우기

How can I make horizontal bands in a grayscale image?

조회 수: 1 (최근 30일)
Deidre
Deidre 2013년 6월 25일
"Give the formula that would create a 400×400 image with 5 horizontal black bands separated by white bands. Write the MATLAB code to make this image and display it."
I have figured out how to make the correct number of bands, but they are vertical instead of horizontal. Anyone know how to make them horizontal? My code so far is below.
colormap(gray(400))
yy = ones(400,1)*cos(2*pi*(0:399)/80);
show_img(yy);

채택된 답변

Jeff E
Jeff E 2013년 6월 25일
yy = (ones(400,1)*cos(2*pi*(0:399)/80))';

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by