MATLAB: Keep getting error Undefined function or variable ‘stack’, why

MATLAB

Hi,
I am using Matlab 2015b with statistics toolbox. But I keep getting Undefined function or variable 'stack', why?
Thanks.

Best Answer

stack(myTbl, 2:end)
The "end" can be interpreted as index only and then Matlab assumes, that "stack" is an array. When you want to use the stack command, Matlab cannot guess what end is related to. Try:
stack(myTbl, 2:4)
and then find out. how you can express the end as you need it.
Related Question