# Create Size 256 × 150 image that have 256 colors on it starting 0 till 255 (the first row is black, the last row is white, and in between all the gray shades).

1 view (last 30 days)
Abd a on 11 May 2022
Edited: DGM on 12 May 2022
.Create Size 256 × 150 image that have 256 colors on it starting 0 till 255 (the first row is black, the last row is white, and in between all the gray shades).
##### 2 CommentsShowHide 1 older comment
Abd a on 11 May 2022
Thank you.

Sign in to comment.

### Accepted Answer

DGM on 11 May 2022
Something like this:
A = uint8(repmat((0:255).',[1 150]));
imshow(A)
##### 3 CommentsShowHide 2 older comments
DGM on 12 May 2022
It didn't really seem like an obvious homework assignment to me. Granted, it's often difficult to distinguish a slightly-abstracted statement of a beginner problem from a contrived homework problem.

Sign in to comment.

### Community Treasure Hunt

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

Start Hunting!