Convert numerical array to numerical cell array

Post date: Nov 20, 2012 3:53:07 AM

All we have to do is using the command num2cell. This can be very useful when generating label to show in the plot.

>> numArray = [1 2 3 4 200 -1 34] numArray = 1 2 3 4 200 -1 34 >> numCell = num2cell(numArray) numCell = [1] [2] [3] [4] [200] [-1] [34] >> numCell{5} ans = 200 >>