File not found pass to next path
古いコメントを表示
For example :
path1 =char('C:\Users\Windows\Desktop\data base\H\');
path_user1 =char('user1_');
path_exp_1 =char('_h.fid');
path_procpar =char('\procpar');
path_amostra_user1=char('PA06F9ppt','PA06F13tr12','PAJ04100tr17','subs18','tr34','tr1619');
Do a
A=strcat(path1, path_user1, path_amostra_user1, path_exp_1)
To reach the path
C:\Users\Windows\Desktop\H\user1_SAMPLES_h.fid\procpar
So, A=<6x90 char>
Then I read the procpar files with for example a text scan
for i=1:6
TEXT(i,:)=textread(A(i,:),’%s’);
end
TEXT=<6x10 double>
In this case we have all the folders on my pc. If for example in the exp2 path_exp_2 =char('_hmbc.fid'); we don’t have all the folders sample only ‘PA06F9ppt' ,'PA06F13tr12'and 'PAJ04100tr17' When the textscan is going to find the path were the sample 'subs18','tr34', its give an error because in this experiment don’t have this path ??? Error using ==> textread at 167 File not found. How I can fix that and associate the name of the samples that’s exists to the values of that
採用された回答
その他の回答 (1 件)
Jan
2011 年 7 月 3 日
Creating a CHAR array pads the strings with spaces, such that all have the same length:
path_amostra_user1 = char('PA06F9ppt', 'PA06F13tr12', ...
'PAJ04100tr17', 'subs18', 'tr34', 'tr1619');
Now the line containing 'tr34' has 7 trailing spaces. But I assume the filename does not have these spaces. If this is the problem, use a cell string instead.
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!