登录论坛

查看完整版本 : [MATLAB基础] fwrite的一个写入数据的问题


evil626
2009-11-16, 01:33
一个M文件中
line{01} = ['* Matlab created *.cir-file *'];
line{02} = ['C_C_fast PATCH 0 ' num2str(p.Cfast)];
line{03} = ['R_R_series PATCH CELL ' num2str(p.Rseries)];
line{04} = ['V_V_stm PATCH 0 PWL FILE "..\TEMP\V_stim.pwl"'];
line{05} = ['R_R_free CELL 0 ' num2str(p.Rfree)];
line{06} = ['C_C_free CELL 0 ' num2str(p.Cfree)];
line{07} = ['I_I_free CELL 0 PWL FILE "..\TEMP\I_free.pwl"'];
line{08} = ['R_R_attached CELL FET ' num2str(p.Rattached)];
line{09} = ['C_C_attached CELL FET ' num2str(p.Cattached)];
line{10} = ['I_I_attached CELL FET PWL FILE "..\TEMP\I_atta.pwl"'];
line{11} = ['R_R_Junction FET 0 ' num2str(p.Rjunction)];
line{12} = ['R_R_lowpass� OUT FET ' num2str(p.Rlowpass)];
line{13} = ['C_C_lowpass 0 OUT ' num2str(p.Clowpass)];
line{14} = ['.TRAN ' t num2str(p.Time(2)) 'ms'];
line{15} = ['.PROBE'];
line{16} = ['.END'];

% writing netlist to file
fid = fopen('../TEMP/TEMP.CIR', 'wb');
for i = 1:length(line)
fwrite(fid, [line{i} char(13) char(10)], 'char');
end
:(
请教下fwrite中[line{i} char(13) char(10)]什么意思? 特别是char(10)和char(13)!!!
:eek:谢谢啦
COUNT=fwrite(fid,A,precision)
说明:其中COUNT返回所写的数据元素个数(可缺省),fid为文件句柄,A用来存放写入文件的数据,precision代表数据精度