how to plot segments with different colors

조회 수: 30 (최근 30일)
Simone Panada
Simone Panada 2019년 5월 21일
편집: Eng. Fredius Magige 2019년 7월 3일
Hi everyone, I need to make a 3d plot of a serial robot modelled with segments.
I would like to plot every joint of the robot with different colors.
Now i plot my robot with red segments with :
plot3([0 x1 x2 x3 x4 x5],[0 y1 y2 y3 y4 y5],[0 z1 z2 z3 z4 z5], 'LineWidth',2,'color','r');
how can i have every segment with color?
(each time instant the figure will change because of the robot movment so every time instant i need to plot the robot and then replace it with the next position of the segments)

답변 (2개)

Saumya Goel
Saumya Goel 2019년 5월 24일
You may consider having a look at this MATLAB answer, if this helps with the query:

Eng. Fredius Magige
Eng. Fredius Magige 2019년 7월 3일
편집: Eng. Fredius Magige 2019년 7월 3일
Hi You could turn to "g/gplot" then select the column/row as coloring characteristics as "weigh" properties requirement. It will help you not only colors but also line width. It might demanding adjacent matrix. Thanks

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by