필터 지우기
필터 지우기

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에서 Files and Folders에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by