필터 지우기
필터 지우기

Help Plotting this function

조회 수: 1 (최근 30일)
clayton holmes
clayton holmes 2021년 12월 8일
답변: Cris LaPierre 2021년 12월 24일
When i plot this nothing shows on the graph. Is this just a domain issue?
lamda= (1/(pi)^0.5)*cp*To*(1/L);
y = lamda*erf(lamda)*exp(lamda*lamda);
plot(lamda,y)
  댓글 수: 1
Voss
Voss 2021년 12월 8일
Hard to say, without knowing what cp, To, and L are. If those are all scalars, then lamda and y will be scalars and the plot will be a plot of one point, which is hard to see with default plot line settings. Alternatively, if any of those have NaNs or Infs in them, those points wouldn't show up on the plot as well.

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 12월 24일
If there is no error message, the most common reason is that you are plotting a single point. By default, MATLAB does not use a marker when plotting; just a line. When your data is a single point, there is no line, so nothing is visible in the figure.
Try adding a marker symbol to your linespec and see if something appears.
cp = 1;
To = 2;
L = 3;
lamda= (1/(pi)^0.5)*cp*To*(1/L);
y = lamda*erf(lamda)*exp(lamda*lamda);
plot(lamda,y,'r-o')

카테고리

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