Making rectangle with different colors
Ältere Kommentare anzeigen
How do I make rectangles using matrices where all the sides in the rectangles have different colours? Should I use the line-function or does it work with the rectangle-function?
Akzeptierte Antwort
Weitere Antworten (1)
KSSV
am 18 Apr. 2018
P = [0 0 ;
1 0 ;
1 1 ;
0 1 ;
0 0] ;
figure
hold on
plot(P(1:2,1),P(1:2,2),'r')
plot(P(2:3,1),P(2:3,2),'b')
plot(P(3:4,1),P(3:4,2),'g')
plot(P(4:5,1),P(4:5,2),'y') 1 Kommentar
Sivert van Mourik
am 18 Apr. 2018
Kategorien
Mehr zu Polygons 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!
