[問題] 讀檔案的疑問~沒辦法讀一整行已回收

看板MATLAB作者 (此ID停止使用)時間15年前 (2010/08/17 14:53), 編輯推噓0(004)
留言4則, 3人參與, 最新討論串1/1
Correlation H0~350\Bz_Corre\All SZA_TEC1\Bz_TEC1_correlation.txt Correlation H0~350\Bz_Corre\All SZA_TEC2\Bz_TEC2_correlation.txt Correlation H0~350\Bz_Corre\All SZA_TEC3\Bz_TEC3_correlation.txt 類似這樣的一個list fid = fopen('correlation plot\correlation_list.txt','r'); AllName = textscan(fid, '%s'); folders = strvcat(AllName{1}); fclose(fid); Nfolder = size(folders,1); for i=1:Nfolder foldernow = deblank(folders(i,:)); end 這樣的foldernow不是 Correlation H0~350\Bz_Corre\All SZA_TEC1\Bz_TEC1_correlation.txt 而是只有 Correlation 請問怎樣可以讀一整行阿??是不是中間不能有空格之類的..=.= 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.45.3 ※ 編輯: sweetdance 來自: 140.116.45.3 (08/17 14:55)

08/17 15:02, , 1F
fgetl()
08/17 15:02, 1F

08/17 15:10, , 2F
這樣可以取到第一行的~第二行的我還在try~"~看help中
08/17 15:10, 2F

08/17 15:29, , 3F
textscan(fid, '%s','delimiter',sprintf('\n'));
08/17 15:29, 3F

08/17 16:49, , 4F
謝謝~我完成了~感激
08/17 16:49, 4F
文章代碼(AID): #1CQZ7pLM (MATLAB)