24小时热门版块排行榜    

查看: 489  |  回复: 0

石广次郎

新虫 (初入文坛)

[求助] 撰写了一段程序,textscan运行时提示文件无法打开,急急急!!!!

撰写了一段程序,运行时提示文件无法打开,急急急!!!!
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
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 石广次郎 的主题更新
信息提示
请填处理意见