2020b update 4 - scatterhist - help example does not work

Hello,
I was trying to use scatterhist and was getting an error. I tried to run the example code (create a scatterhist Plot) from the help documentation in 2020b update 4 and get the following below. Any assistance would be appreciated. I also tried the example in 2019b, and got the same error. I also tried the example following the first one (plot grouped data) and got an error.
>> load fisheriris.mat
>> x = meas(:,1);
>> y = meas(:,2);
>> scatterhist(x,y)
y =
3.8 8.2
Error using *
Incorrect dimensions for matrix multiplication. Check that
the number of columns in the first matrix matches the
number of rows in the second matrix. To perform
elementwise multiplication, use '.*'.
Error in scatterhist (line 450)
set(hScatter,'Xlim', XhistXlim + [-0.01,
0.01]*range(XhistXlim));
Related documentation
>> scatterhist(x,y,'Group',species,'Kernel','on')
y =
4.3 7.9
Unable to perform assignment because the size of the left side is 1-by-0 and the size of
the right side is 1-by-100.
Error in internal.stats.plotGroupedKSDensity (line 101)
px(i,:) = ksdensity(xg,xrange);
Error in
scatterhist>@()internal.stats.plotGroupedKSDensity(x,grp,'Color',clr,'LineWidth',lw,'LineStyle',lStyle,'Width',ww1)
(line 291)
Xfunc = @()internal.stats.plotGroupedKSDensity(x,grp,...
Error in scatterhist (line 393)
Xfunc();

 Akzeptierte Antwort

Steven Lord
Steven Lord am 18 Feb. 2021

0 Stimmen

Do you perhaps have a function named range.m that's taking precedence over the range function included in Statistics and Machine Learning Toolbox?

1 Kommentar

Yes! I searched on the path and foudn another file named range.m. I removed that file from the path and that fixed the issue. Thank you for your help!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by