How can I create an image in MATLAB by creating a 3D RGB matrix and display it in a MATLAB window?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
The image should look like a red square above a blue square.
0 Kommentare
Antworten (1)
Bshara Murr
am 27 Nov. 2017
new = 255 * ones(dimensions, dimensions, 3, 'uint8');
new(:,:,2) = 0;
imshow(new);
The second line sets the green channel to zero
5 Kommentare
Bshara Murr
am 27 Nov. 2017
Bearbeitet: Bshara Murr
am 27 Nov. 2017
new = 255 * ones(100, 50, 3, 'uint8');
new(1:50,:,2) = 0;
new(1:50,:,3) = 0;
new(51:100,:,2) = 0;
new(51:100,:,1) = 0;
imshow(new);
Is this what you are looking for?
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!