⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addpw.m

📁 matlab book matlab book2
💻 M
字号:
function success = addpw(NAME,pwtoadd)
% takes username and password, adds username to list and creates file with
% password signal data 
%
% append username to list, with one username per list
ulist = fopen('userlist.txt','a');
if (ulist < 0)
   error('could not open file');
   success = 0; return;
end;
fprintf(ulist,'%s\n',NAME);
fclose(ulist);

% create file of signal data
pfilename = [NAME '.txt']; 
pfile = fopen(pfilename,'w');
if (pfile < 0)
   error('could not open file');
   success = 0; return;
end;

% write data to file
[pwrows,pwcols] = size(pwtoadd);
for rcount = 1:pwrows
    for ccount = 1:pwcols % should be 12 (number of co-efficients)
        fprintf(pfile,'%f\n',pwtoadd(rcount,pwcols));
    end;
end;

fclose(pfile);
success = 1; % output that files changed/added successfully
% otherwise zero

return;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -