Scatter() working but not Plot()
이전 댓글 표시
Hello,
I am having trouble getting plot() to work. My code works if I use scatter() instead of plot(). If I used plot(), then I get Error in plot(x,y). Can someone please tell me why plot is not working? Thanks!
x = 1:10;
y = x.^2;
figure
hold on
plot(x,y)
hold off
댓글 수: 6
Steven Lord
2018년 11월 1일
What is the FULL text of the error message you receive? Show everything displayed in red.
Kateri Kaminski
2018년 11월 1일
Image Analyst
2018년 11월 1일
편집: Image Analyst
2018년 11월 1일
No, that's not EVERYTHING in red. Most importantly, the actual error message is not there. Please include everything. Put
clc
as the first line in your code, then copy the entire contents of the command window (after it errors) and paste it back here. For me the code runs and products this:

KSSV
2018년 11월 2일
I suspect...he have another function on the name plot. He is not using inbuilt function plot. What does which plot display?
Walter Roberson
2018년 11월 2일
My guess is that there is a variable named plot
Kateri Kaminski
2018년 11월 2일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!