撰写了一段程序,运行时提示文件无法打开,急急急!!!!
clear all;
close all;
fprintf('Working...>\n')
wssx_line = [73260 121729]; % specify the line number of wss_x component data located
wssy_line = [121731 170200]; % specify the line number of wss_y component data located
wssz_line = [170202 218671]; % specify the line number of wss_z component data located
row = [1 5];
m = wssx_line(2)-wssx_line(1)+1;
n = row(2)-row(1)+1;
[FileName,PathName] = uigetfile('*.dat','Select the dat files','MultiSelect', 'on');
k = length(FileName);
fprintf('>All the Dat files has read completely>working...\n\n');
for ii = 1:k
fid(ii) = fopen( FileName{ii});
temp = textscan(fid(ii),'%s %s %s %s %s',1000000,'bufSize', 265000000);
fclose(fid(ii));
for i = 1:m
for j = 1:n
wss_temp_x(i,j,ii) = str2num(temp{j+row(1)-1}{i+wssx_line(1)-1}); % wall shear stress_x
wss_temp_y(i,j,ii) = str2num(temp{j+row(1)-1}{i+wssy_line(1)-1}); % wall shear stress_y
wss_temp_z(i,j,ii) = str2num(temp{j+row(1)-1}{i+wssz_line(1)-1}); % wall shear stress_z
% uds_temp(i,j,ii) = str2num(temp{j+row(1)-1}{i+uds_line(1)-1}); % uds_line
end
end
wss_x(1,:,ii) = reshape(wss_temp_x(:,:,ii)',1,m*n); % Reshape wall shear stress_x
wss_y(1,:,ii) = reshape(wss_temp_y(:,:,ii)',1,m*n); % Reshape wall shear stress_y
wss_z(1,:,ii) = reshape(wss_temp_z(:,:,ii)',1,m*n); % Reshape wall shear stress_z
% uds(1,:,ii) = reshape(uds_temp(:,:,ii)',1,m*n); % Reshape uds temp
end
![撰写了一段程序,textscan运行时提示文件无法打开,急急急!!!!]()
截图00.jpg |