Where is plotSlice?

2 views (last 30 days)
mackeca on 1 Sep 2022
Commented: mackeca on 1 Sep 2022
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

Steven Lord
Steven Lord on 1 Sep 2022
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:
Unrecognized function or variable 'plotSlice'.
  1 Comment
mackeca on 1 Sep 2022
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)

Community Treasure Hunt

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

Start Hunting!

Translated by