1. 程式人生 > >常用matlab代碼筆記

常用matlab代碼筆記

atl 常用 txt文件 成對 open 代碼 slice n) bsp

1.生成對應路徑下的圖片及寫入txt文件:

Eg:

imwrite(X1,strcat(‘path‘,num2str(n),‘slice_‘,num2str(j),‘.bmp‘));
c=fopen(‘path.txt‘,‘wt‘); %寫入txt
str=[strcat(‘T2case‘,num2str(n),‘slice_‘,num2str(j),‘.bmp‘,‘ 0‘ )];
fprintf(c,‘%s\n‘,str)

常用matlab代碼筆記