How can i plot a graph with different y values for a particular x value?

조회 수: 2 (최근 30일)
Deepak d
Deepak d 2018년 5월 11일
댓글: Deepak d 2018년 5월 11일
x=0.2
y=3,5,7

채택된 답변

KSSV
KSSV 2018년 5월 11일
x=0.2 ;
y=[3,5,7]
plot(x,y,'*r')
In such cases, you need to use a marker.
  댓글 수: 1
Stephan
Stephan 2018년 5월 11일
Hi,
nice to know - i always thought length of x and y have to be equal.
Best regards
Stephan

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

추가 답변 (1개)

Stephan
Stephan 2018년 5월 11일
편집: Stephan 2018년 5월 11일
Hi,
x(1:3) = 0.2;
y = [3 5 7];
plot(x,y, '*', 'color', 'r')
gives you:
Best regards
Stephan

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by