Need to stop warning because i need to not show a plot using compassplot
조회 수: 21 (최근 30일)
이전 댓글 표시
Warning: Plotting the real and imaginary components of the value provided. Specify both R and Theta values if you do not intend to plot a complex value.
댓글 수: 2
the cyclist
2025년 12월 8일
I don't recognize that as a warning from a MATLAB function.
Can you post the full code that gives that warning?
Walter Roberson
2025년 12월 9일
Simple testing does not appear to show that message?
compassplot([1 2+3i 2-3i])
채택된 답변
Norman
2025년 12월 19일
댓글 수: 3
Walter Roberson
2025년 12월 19일
Oddly enough, if you do provide something with real and imaginary components, you do not get the warning.
compassplot(1)
compassplot(1+2i)
Paul
2025년 12월 19일
I can only guess from the text of the warning that the developers assume that if the user inputs a value with a non-zero imaginary part that the user meant it, but if the input has zero imaginary part then the user might be making a mistake (not sure what that mistake could be). But I could be wrong because the behavior is documented, though one could argue it could be a tad more clear on this particular case. Personally, I think this warning is overkill, though I'd be interested if there's some corner case where it helps keep the user from doing something unintended.
Note that the warning still shows up even if the input explicitly has a complex attribute
x = complex(1,0);
whos x
compassplot(x)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





