MATLAB: How to do this Data analysis

data analysis

I am having 5 .mat files. Each mat file contains 5 parameters. A,B,C,D,E
Now I want to plat a graph which will be considering all mat files.
I want to take C variable which is of a size 200×1 from each mat file, take mean of it for that mat file and then plot it against time.
So at the end I will get a graph with 5 points representing mean of the respective C columns from .mat file.
Can anyone help me to do this?
Here is what I have done till now:
clear all; clc;
myFolder = 'C:\Users\adi\Documents\MATLAB\';
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
filePattern = fullfile(myFolder, '*.mat');
matFiles = dir(filePattern);
for k = 1:length(matFiles)
end
This is reading the files from my folder. Now Please help me to analyze them!

Best Answer

In the body of your for loop, write
load(matFiles(k).name)
plot(k, mean(C), '.')
if k == 1, hold on, end