i have a cell array of string content and i want to turn the contents of cell 2 into ordinal values according to the list shown below in 'clinicalVAL.png'
catnames = { 'stage i'; 'stage ia'; 'stage ii'; 'stage iia'; 'stage iib'; 'stage iic'; 'stage iii'; 'stage iiia';'stage iiib'; 'stage iiic'; 'stage iv'; 'stage iva'; 'stage ivb'}; valueset={1;2;3;4}; for i=1:217 B = categorical(Ystg{i}(2),catnames,valueset,'Ordinal',true); end
I have tried this code but doesn't work and i want to do it programmatically and not manually; is it possible in MATLAB?
ERROR: Error using categorical
Creating an instance of the Abstract class 'categorical' is not allowed.
Best Answer