Index character in table
Ältere Kommentare anzeigen
In a dataset, I would like to get rid of the letter within the seatnumber on an aircraft: '026C' to 026. For this I am trying to index the first three characters of the string, which I can't get to work.
This is one of the things I tried:
A = cell(1,2);
A{1,1} = '024C';
A{1,2} = '005B';
A(1,1) = A(1,1,1:3)
Can somebody tells me how this indexing works?
Akzeptierte Antwort
Weitere Antworten (1)
Andrei Bobrov
am 6 Dez. 2017
out = cellfun(@(x)x(1:3),A,'un',0);
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!