MATLAB: Store .csv data and calculate average value

averagecsvplottingstore data

Goodmorning to everybody.
Can someone help me to understand how I can save in matlab 10 .csv files, select only the columns in which I am interested and get as output a final plot in which I have the average value of the y coloumns and standard deviation of y axes? I am not so good in matlab and so I kindly ask if someone to help me to solve this question.
Thanks in advance.

Best Answer

Roughly,
which_column = 7; %for example
for K = 1 : 10
filedata = csvread(FileNames{K})
columndata(:,K) = filedata(:,which_column);
end
columnavg = mean(columndata,2);
columnstd = std(columndata,2);
xvals = 1 : size(columnavg,1);
plot(xvals, columnavg, 'b-', xvals, columnavg-columnstd, 'r--', xvals, columnavg+columstd, 'r--');
This would plot the average and would also plot the positions that are 1 standard deviation above and below the average.