Wrong sine plot when styling it
조회 수: 2 (최근 30일)
이전 댓글 표시
I was playing with the tutorial of Matlab. I've written this code:
x = linspace(0, 2*pi);
y = sin(x);
plot(x, y)
And I obtain the right plot:
But then I use the following command:
plot(x, y, "r--")
And I obtain this weird plot:
What I'm doing wrong?
댓글 수: 2
Steven Lord
2024년 5월 7일
Let's check which plot function you're calling in each case.
x = linspace(0, 2*pi);
y = sin(x);
which plot(x, y)
which plot(x, y, "r--")
In particular, I'm wondering if something added an overload of plot for the string data type to the MATLAB path.
And just for completeness, what does the next line of code show and what is the output of the which call that follows it?
plot(x, y, 'r--')
which plot(x, y, 'r--')
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!