varfun does this with no problem:
>> t = table(["123";"456"],{'789'; '012'},[345;678]) t = 2×3 table Var1 Var2 Var3 _____ _____ ____ "123" '789' 345 "456" '012' 678 >> t2 = varfun(@str2double,t,'InputVariables',@(x) ~isnumeric(x)) t2 = 2×2 table str2double_Var1 str2double_Var2 _______________ _______________ 123 789 456 12
The problem now is how to get those converted values back into the original table. Because () and {} subscripting are assigning to "elements", and not to "whole variables", you can't convert a variable's type with, for example, t(:,1:2) = t2. Instead:
t.Var1 = t2.Var1; t.Var2 = t2.Var2;
or perhaps
t = [t2 t(:,3)]