[問題] 輸出數據在檔案裡寫成矩陣形式已回收

看板MATLAB作者 (嚕拉拉)時間16年前 (2009/04/24 17:18), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
cd F:\figure\ workdir = 'F:\figure\'; % working file dir [filename, pathname, filterindex] = uigetfile('*.tif', 'Pick an tif-file'); sfile1 = strrep(figure, '.tif', 'coordinate.txt'); f=imread('crossline.tif'); % read the image which name is '-.tif' figure(1), imshow(f); [rows,columns]=find(f==0); % find black points because there intensity are 0 c=[columns,rows]; % set matrix c to place the coordinates disp(c); fid = fopen('coordinate.txt','w'); fprintf(fid, '%d \t %d\n',c); fclose(fid); 以上是我的程式語言內容 figure是檔案名稱 crossline.tif是隨意畫的圖形 coordinate.txt是數據寫入的檔案名稱 現在的問題是 如何將輸出的數據 c=[columns,rows] 寫成矩陣形式呢? 我知道要在最後一段加入迴圈 請問該怎麼寫呢? 這是個286*2的矩陣 感謝各位 -- 人生可貴朋友情 尋之當珍惜 世間難得知己心 得知且相惜 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.72.3
文章代碼(AID): #19yOFLuW (MATLAB)
文章代碼(AID): #19yOFLuW (MATLAB)