![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176831/image.jpeg)
Form an image of vertical ramp having a ramp values from 0 to 255 and dimension 256x256.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
John BG
am 25 Jan. 2017
Pravin
this is ramp
A=uint8(repmat([0:1:255]',1,256))
imshow(A)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176831/image.jpeg)
.
you can save the image in JPEG format:
.
imwrite(A,'ramp.jpg')
.
if this is the kind of ramp you are looking for would you please be so kind to mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John BG
8 Kommentare
Guillaume
am 26 Jan. 2017
@John,
As pointed out by Image Analyst, it is a default install of the latest version, R2016b, that gives the warning.
As for 2017-prerelease, as per the NDA you implicitly agreed to if you downloaded it, we're not allowed to talk about it.
Weitere Antworten (1)
Jorge Mario Guerra González
am 24 Jan. 2017
Bearbeitet: Jan
am 26 Jan. 2017
I suppose you want a ramp horizontally, since you only want values from 0-255 in a 256x256 matrix. Filled with integers.
X=uint8(0:255);
x=meshgrid(X,X);
imshow(x, [])
3 Kommentare
Jorge Mario Guerra González
am 25 Jan. 2017
Bearbeitet: Jorge Mario Guerra González
am 25 Jan. 2017
Sorry I wrote the code before without using matlab.
X=0:255;
x=meshgrid(X,X);
imshow(x,[]) %although it uses more memory
that one works as well using imshow(x,[ ]), I corrected it
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!