MATLAB: Make cell and put number on it

make cell and put number on it

n=20;
I want to make a cell from 1 to n
result should be
result={[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[14],[15],[16],[17],[18],[19],[20]}

Best Answer

You can do it like this:
n=20;
result=num2cell(1:n);