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.2Error using * Incorrect dimensions for matrix multiplication. Check thatthe number of columns in the first matrix matches thenumber of rows in the second matrix. To performelementwise 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.9Unable to perform assignment because the size of the left side is 1-by-0 and the size ofthe right side is 1-by-100.Error in internal.stats.plotGroupedKSDensity (line 101) px(i,:) = ksdensity(xg,xrange);Error inscatterhist>@()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();
Best Answer