avrgae and standDev... Data should be vector Problem??

4 views (last 30 days)
ahmed on 28 Oct 2013
Commented: ahmed on 29 Oct 2013
I am trying to plot the average and stand Dev for my lab data, I have like 8 text files (results), I did a loop to get all of them form file directory. Then import these data into matlab to able to work on them to obtain average values and StaDev. into plot.
each text file contains (3 C , 20 R). this the code to get the files form directory
dataDirectory = 'C:\Users\aam\Desktop\noies,';
allFilesDir = dir(fullfile(dataDirectory , '*.txt'));
allFN = {allFilesDir.name};
for n = 1:length(allFN)
Mat{n}=importdata(['' num2str(n) '.txt']);
now all files imported in matlab
I am tring to use :
for x=1:3
xlabel('Noise (rms)');
ylabel('Sample Number');
[average,standdev] = normfit(A); % Fit of Distribution
but i got this In an assignment A(I) = B, the number of elements in B and I must be the same.
or data should be vector
xlabel('Noise (rms)');
ylabel('Sample Number');
[average,standdev] = normfit(Mat); % Fit of Distribution
any ideass ???
ahmed on 28 Oct 2013
Ok . I have 8 file named as (1:8).txt I am trying to automatize the plotting part using loop but I have a problem concerning using cell..

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 28 Oct 2013
Why are you passing the entire cell array Mat into histfit()?
  1 Comment
ahmed on 29 Oct 2013
I want to do a loop to get the 'average,standdev' for all data in the text files in this sequence Ex ({1,8}(1:20,3))) ....

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!