MATLAB: How to find character bigrams from a string

bigramstext;

Hello, I would like to find all character bigrams from a string sentence. For example night -> {ni,ig,gh,ht}. Is there a Matlab code?
Thank you very much

Best Answer

str = 'night';
list = cellstr([str(1:end-1); str(2:end)].')