Why only scatter function is not working?
Mostra commenti meno recenti
x=27:0.5:29
y= [2.41 2.4 2.395 2.39 2.38]
scatter(x,y)
scatter plot is not showing by using thus code.Please clarify.
10 Commenti
It's working here.
x=27:0.5:29;
y= [2.41 2.4 2.395 2.39 2.38];
scatter(x,y)
What is the output for you?
Walter Roberson
il 11 Ott 2023
Did you accidentally create a variable named scatter?
dpb
il 11 Ott 2023
Type
clear scatter
at command line and all trouble will (almost certainly) disappear! :)
It's what all the above were driving at -- you undoubtedly accidentally created a variable scatter the is aliasing the function.
If you created another m-file function by the name of scatter, that would do it, too, but that's much less likely -- but the which would show it up. In that case, of course, if it is a function you need/want, then rename it something like "myscatter.m" or, if it was an accident, just delete it.
Bruno Luong
il 12 Ott 2023
If scatter was a variable accidently created then scatter(x,y) would throw an error. So I don't think this is the case.
Walter Roberson
il 12 Ott 2023
You are correct that with non-integer x and y and if scatter was a numeric variable (most types of variables actually) then scatter(x,y) would generate an error. (But there are some places it would not, such as if scatter happened to be a function handle with 2 parameters)
However... I have seen in the past that people have said that an output is "not showing" (or similar wording about not seeing the output) when the code was generating error messages. People do not always notice the error messages, or do not always think they are significant.. or sometimes they just don't mention error messages that look pretty significant, expecting that we will immediately know the error message just be reading their code...
GD
il 12 Ott 2023
GD
il 12 Ott 2023
GD
il 12 Ott 2023
GD
il 12 Ott 2023
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Scatter Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




