I have a 2417-by-50 structure array in MATLAB and am trying to find a vectorized way to convert some of the field types:
I have a column of characters that I want to convert into a string type:
[DataS.Sector] = string([DataS.Sector]);
but its not working. I don't want to use a loop since it take so much time.
Same issue, but converting to numeric values. Right now I'm using a loop that takes a really long time:
for i = 1:length(DataS) for j = 1:numel(Vectorpour) DataS(i).(DataSfieldname{k}) = str2double(DataS(i).(DataSfieldname{k})) end end
How can I vectorize each of these approaches?