[問題] 輸出數據在檔案裡寫成矩陣形式已回收
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
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章