Want to open a multiple file
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!