Why is the dashed red line for the second plot in the following code not appearing when I run the code?
조회 수: 3 (최근 30일)
이전 댓글 표시
I am using matlab r2014 on a macbook and I can't get the second plot to appear with a dashed red line. Here is the code:
for n=(10:100) k=(0:n); pie= 4*sum(((-1).^k)./(2.*k+1)); a(n-9)= pie end m=[10:100]; hold on plot(m,a) plot(m,pi,'--r') hold off
댓글 수: 0
답변 (1개)
Mischa Kim
2014년 9월 16일
편집: Mischa Kim
2014년 9월 16일
Manuel, use
plot(m,pi*ones(size(m)),'--r')
instead. The first and second arguments in the plot command should be vectors of equal size.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Pie Charts에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!