Scatter() working but not Plot()
Afficher commentaires plus anciens
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 commentaires
Steven Lord
le 1 Nov 2018
What is the FULL text of the error message you receive? Show everything displayed in red.
Kateri Kaminski
le 1 Nov 2018
Image Analyst
le 1 Nov 2018
Modifié(e) : Image Analyst
le 1 Nov 2018
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
le 2 Nov 2018
I suspect...he have another function on the name plot. He is not using inbuilt function plot. What does which plot display?
Walter Roberson
le 2 Nov 2018
My guess is that there is a variable named plot
Kateri Kaminski
le 2 Nov 2018
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!