Graph line not showing
조회 수: 1 (최근 30일)
이전 댓글 표시
So I have an equation and some variables to substitute in for, but I cannot get my graph to have a line. I know others have asked similar questions but I am stuck.
X = 20;
P = 20;
r = 20;
theta = 30;
y = ((X*P)./(2*pi*r.^2))*cos(theta).^(X-2);
plot(y)
댓글 수: 0
답변 (1개)
Asad (Mehrzad) Khoddam
2020년 9월 6일
Several issues in your code:
1- it has only one point (use plot(x, y) )
2- The angle should be in radians not degrees. For angles in degrees you can use 'cosd' instead of 'cos'
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Directed Graphs에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!