필터 지우기
필터 지우기

In this code plot(t,AC(​3,:),'-r',​t,AC(2,:),​'-g',t,AC(​1,:),'-b')​; what is the value/essence of the '-r', '-g' and '-b'?

조회 수: 2 (최근 30일)
thank you very much
  댓글 수: 1
Stephen23
Stephen23 2018년 3월 21일
@Warda Panondi: have you read the plot documentation? It clearly explains the line specification options. Not only that, the documentation is easy to find: it is installed on your computer with MATLAB itself, so you just need to type
doc plot
or
help plot
The help is also online: this is the very first link provided by a major internet search engine:
Reading the documentation yourself is a lot faster than posting questions on forums and then waiting for random strangers to go and read that documentation on your behalf.

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2018년 3월 21일
The ‘-r’, ‘-g’, and ‘-b’ tell the plot function you are using to plot ‘t,AC(3,:)’ with a red solid line, ‘t,AC(2,:)’ with a green solid line, and ‘t,AC(1,:)’ with a blue solid line.

추가 답변 (1개)

Geoff Hayes
Geoff Hayes 2018년 3월 21일
편집: Geoff Hayes 2018년 3월 21일
Warda - the strings are referring to the line style, marker, and colour (see 2D line plot spec). The 'r', 'g', and 'b' are referring to the colour of the plots: red, green, blue. The '-' indicates that a solid line should be drawn.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by