How to calculate zero mean and unit variance for entire vectors in a folder?

1 次查看(过去 30 天)
I am supposed to calculate zero mean and unit variance for a vector.These vector values are present in excel sheet.There are many such excel sheets in a folder, for all these excel sheets containing data for which I need to find out zero mean and unit variance are present in a folder. How can I write the code to calculate zero mean and unit variance for all these vectors in a folder at a time. Can u please help me with the code

回答(1 个)

Thorsten
Thorsten 2015-6-29
1. Determine all excelfiles in the folder (hint: d = dir(',', '*.xls'))
2. loop over all these files and
3. read file (hint: D = xlsread(d(i).name);
4. compute mean and variance (hint: m = mean(D(:)), v = var(D(:));
5. exit loop if m == 0 && v == 1, in this case disp('found') (hint: break)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by