Hi,
I have a table myTable that has a column called Prices (column 3). I want to calculate the mean, and std, of the log return. The code is not very nice. How to make it better? Here is my code:
myarray = myTable(:, 3)for i = 2:size(myTable, 1) mylog = log10(myTable{i, 3)/myTable(i-1, 3)); myarray{i-1} = mylogendmymean = mean(myarray)mystd = std(myarray)
Actually, I have a set of such tables, and I will create a set of means and stds and put this set into another table. I am wondering how to do it nicely since I don't want to make many for loops. And since the amount of data is huge, I want to make the speed fast in computing.
Thank you!
Jen
Best Answer