MATLAB: Assigning outputs variable names

variable

I'm using the function findchangepts, which outputs 2 numerical values for me. I'd like to use these values and manipulate them further. How can I assign them separate variable names?
Thank you!
SamplNum = findchangepts(SensV, 'MaxNumChanges', 2);
% code
end
which gives
SamplNum =
21194
21609
So I'd like to assign both of those sample numbers a variable in order to manipulate them.
Thanks for your help, sorry if this is a simple question/answer, I'm new to Matlab!

Best Answer

I am not sure how the function is working, but you could simply do
Variable_1=SamplNum(1);
Variable_2=SamplNum(2);
or you do
[Variable_1, Variable_2] = findchangepts(SensV, 'MaxNumChanges', 2);
and adapt the code in-between.