Formatting table display in Matlab -


i have table different type of columns. exporting excel function writetable(...). wondering how display columns in different format.

e.g. format in % rounded 2 integers. e.g. 0.025 --> 2.5%.

t = table; t.('test') = rand(100,1,1); 

the easiest way if formatted in table. can open excel via matlab , programmatically format there it's lot more cumbersome.

t = array2table(rand(3)) t.(3) = cellstr(num2str(t.(3)*100, '%4.2f%%')) writetable(t, 'test.csv') 

t =

 var1        var2       var3   _______    ________    _______  0.73634     0.70405    0.33086 0.39471     0.44231    0.42431 0.68342    0.019578    0.27027 

t =

 var1        var2        var3   _______    ________    ________  0.73634     0.70405    '33.09%' 0.39471     0.44231    '42.43%' 0.68342    0.019578    '27.03%' 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -