I have a cell array:
A = {NaN, ‘k’, ‘m’, ‘n’}
I want to replace all but the 3rd element of A with NaNs to obtain
B = {NaN, NaN, ‘m’, NaN}
Please, any help/suggestions on how I could go about this? Also, is it possible to do this with a single line of code?