The title says it all. I'm using 2019a and trying to visualize some statistical models. I often use plotSlice for that (https://www.mathworks.com/help/stats/linearmodel.plotslice.html). It doesn't appear to have changed over the years, and after uninstalling/reinstalling the stats toolbox I'm still getting the "undefined function" error when I try to use it.

 Accepted Answer

How are you calling plotSlice? According to the documentation page plotSlice requires its input to be a "Linear regression model object, specified as a LinearModel object created by using fitlm or stepwiselm, or a CompactLinearModel object created by using compact." [That first link above links to the most recent documentation, but this hasn't changed since release R2019a.] If you tried calling this with something like a normal double precision array you'd receive an error:
plotSlice(magic(4))
Unrecognized function or variable 'plotSlice'.

1 Comment

Hi Steven, thanks for your answer. You found the issue. I was using a linear mixed effects model object as the input, which I forgot isn't possible. It works with a linear model object, just not mixed effects models. Thanks again.

Sign in to comment.

More Answers (0)

Products

Release

R2019a

Asked:

on 1 Sep 2022

Commented:

on 1 Sep 2022

Community Treasure Hunt

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

Start Hunting!