Scatter plot undefined variable

조회 수: 7 (최근 30일)
Jackie Yang
Jackie Yang 2019년 8월 14일
댓글: Steven Lord 2023년 8월 9일
Hi, i just started using Matlab for a personal project, I don't have any experience with it.
I'v tried to plot scatter plots with 3 different appropriate data sets and they all get the same error:
HALLLLAO 2019-08-14 at 8.44.59 pm.png
This is the same for every data set that I use...
Can i please get some help trying to fix this? Here's line 56HALLLLAO 2019-08-14 at 8.46.22 pm.png
Thank you!

채택된 답변

Geoff Hayes
Geoff Hayes 2019년 8월 14일
Jackie - is the MATLAB code that you have posted above from the built-in MATLAB scatter function? Or is it something hat you have written? In the command window type
which scatter -all
to see which implementations of this function exist. If more than one exists, then you may want to rename your function to not conflict with the built-in one.
As for the error, at line 55 the boolean allowNonNumeric is defined but allowNumeric is being passed into the getRealData function. If this is your code, then try modifying it to keep the variables consistent.
  댓글 수: 3
Jackie Yang
Jackie Yang 2019년 8월 15일
Hi.
I believe the problem is the built-in scatter function.I never modified anything.
I know for a fact that the problem is insided the built-in coded since I have done numerous trials with fresh data sets and they all get the same error message,so it wouldn't be my mistake...
It sounds like I have to change the built-in function it self, should I directly change it in the scatter.m or somewhere else?
Thankyou!
Jackie Yang
Jackie Yang 2019년 8월 15일
I'v changed the allowNonNumeric to allowNumeric in scatter.m, it seems to work, thank you!
Just wondering does all MATLAB copies comes with NonNumeric settings, I'm pretty sure i've never fiddledd with it.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Andrey Kiselnikov
Andrey Kiselnikov 2019년 8월 14일
편집: Andrey Kiselnikov 2019년 8월 14일
"allowNonNumeric" and "allowNumeric" are different variables, you defined first one and forgot last one (I assume this is mistake).
Good reference with ready to try examples is here
If my help was useful please mark this answer as accepted.
  댓글 수: 1
Jackie Yang
Jackie Yang 2019년 8월 15일
Hi, I tiredd the example codeds, they all seem to work... But my data set doesn't. I was thinking maybe it's to do with the size of the data? I have 2 columns with about 4000 cells each..
Thank you!

댓글을 달려면 로그인하십시오.


Sourov
Sourov 2023년 8월 9일
편집: Sourov 2023년 8월 9일
Not any kinds of 2d scatter plot are functioning in Matlab R2023a. Why?
  댓글 수: 1
Steven Lord
Steven Lord 2023년 8월 9일
What does "Not ... functioning" mean in this context?
  • Do you receive warning and/or error messages? If so the full and exact text of those messages (all the text displayed in orange and/or red in the Command Window) may be useful in determining what's going on and how to avoid the warning and/or error.
  • Does it do something different than what you expected? If so, what did it do and what did you expect it to do?
  • Did MATLAB crash? If so please send the crash log file (with a description of what you were running or doing in MATLAB when the crash occured) to Technical Support so we can investigate.
I'd also make sure that you haven't written a scatter.m file that's taking precedence over the scatter function included as part of MATLAB. Do you see any scatter.m file that are not under the matlabroot directory?
which -all scatter
/MATLAB/toolbox/matlab/graphics/scatter.m /MATLAB/toolbox/matlab/bigdata/@tall/scatter.m % tall method

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by