I have a cellmatrix where there are two columns wth name of months. I want to replace the name of months by serial numbers from 1 to 12.
How can I do it in matlab 2016a?I am new to matlab & I tried using strcmp, strrep & even with switch.
Please suggest.
1)
if strcmp(z1(n,5),month(m,1)) z1{n,5} = strrep(z1{n,5},'z1{n,5}','m') break; else z1{n,5} = z1{n,5}; end
2)
str = z1{n,5};switch (str)case ('January')z1{n,5} = 1;...case ('December')z1{n,5} = 12;end
None worked correctly.
Best Answer