"I have one solution, which is: Data_Out= cellfun(@(x)str2double(x), Data_In);"
Considering that your anonymous function just pass the input straight to str2double, it's not needed:
Data_Out = cellfun(@str2double, Data_In);
would be slightly faster as you're losing the cost of an anonymous function call.
But in any case, str2double is perfectly happy with a cell array input, so the cellfun is not even necessary:
Data_Out = str2double(Data_In);
"However, this solution is very time taxing. I would prefer a more simple solution"
Not having the pointless cellfun should speed it up a bit, but this is already the simplest solution. Parsing strings into numbers is a time consuming process. I really doubt that you're going to find any faster algorithm.
Best Answer