Want to open a multiple file

1 次查看(过去 30 天)
tusu
tusu 2013-1-12
Hello
I have a program now,which open a file ,calculate some value and draw 2 graph.I open a file by using
[filename, filepath] = uigetfile('Choose a binary file');
fullname = fullfile(filepath, filename);
txt = fileread(fullname);
Now if i have folder of 20 such files,store in a folder names ad rboo1.txt to rb020.txt how can I open it simultaneously and shall get my output
my code is
I am converting after reading this rb001 file to decimal.txt
X=csvread('E:\decimal.txt');
R = histc(X,0:255);% the no of occurence
disp(' The no of occurence');
[(0:255).' R(:)]
P = histc(X,0:255)/length(X);% the prob of occurence
disp('The prob of occurence');
[(0:255).' P(:)]
%%%%%%%%%%%%%%%%%Calculation of SigmaW %%%%%%%%%%%%%%%%%%%%
for i=1:1:256
ay=P(i)-0.00391;
ay=ay*ay;
N=R(i)*ay;
d2=d2+N;
d=d+R(i);
end
S=d2/d;
SigmaW=sqrt(S);
plot(0:255,P);
My problem is I need this signaw individually for each file and want to save it after execution of each file,and plot for individual file,my code is working fine,with input file one by one but when I need to do it simultaneously for 20 such file..How can it be possible

回答(1 个)

Jan
Jan 2013-1-12

类别

Help CenterFile Exchange 中查找有关 Structured Data and XML Documents 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by