Saving the average in each iteration of a for loop
1 view (last 30 days)
I have some data and I am trying to get a mean of 4 specific numbers for each row in an excel sheet. Some of my data looks like the below:
I want to save each mean for each row in a matrix "avgthic". My current code looks like this:
for i = 1:height(id)
edges= [athic(i,:), pthic(i,:), mthic(i,:), lthic(i,:)];
%This is averaging only the last row, not row 1, 2, and so on....
the "height(id)" is the height of column with the name of each element each measurement comes from, so I should have the same number of rows as I have id's. How would I get matlab to save each average for each row?