Вот мое решение.Может быть, это может кому-нибудь помочь:
clear all;
clc;
%Filtering log files
l = dir('*.log');
for k = 1:length(l)
next_name = l(k).name
%Array size detection
[rows cols] = size(l);
%Choose a last file
file_name = next_name;
%Reading log last file
fileread = fopen(file_name);
%Convert to float
times = fread(fileread,'float32');
%Filtering times and set to 0 small values
times(times<1e-8)=0;
%Set right times values
times_s = times * 1.0e-06;
%Solve full rotation speed (Hz)
motorspeed_full = 1./(2.*times_s);
%Filtering inf values and set to 0
motorspeed_full(motorspeed_full>1e+10)=0;
%Solve half rotation speed (Hz)
motorspeed_half = 1./(times_s);
A = '.txt';
[filepath,name,ext] = fileparts(file_name);
Xfilename = [name,A];
mkdir(name)
dlmwrite([name,filesep,Xfilename],motorspeed_full,'precision','%.3f');
% [name,'.wav'],[name, file, name, '.wav']
movefile([name,'.wav'],[name, filesep, name, '.wav']);
end