matlabfunction [t,buff1,buff2,comment,par]=IHSread(s);PeakName=['I ';'II ';'III ';'IV ';'V ';'VI ';'VII ';'XX ';'NN ';'Base';'XX ';'XX ';'Na ';'Pa ';'Nb ';'Pb ';'P1 ';'N1 '];PeakSign=[1,1,1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,1,-1];fid=fopen(s,'r');if fid =-

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/05 23:31:29
matlabfunction[t,buff1,buff2,comment,par]=IHSread(s);PeakName=[''I'';''II'';''III'';''IV'';''V'';''VI'';''VII'';''X

matlabfunction [t,buff1,buff2,comment,par]=IHSread(s);PeakName=['I ';'II ';'III ';'IV ';'V ';'VI ';'VII ';'XX ';'NN ';'Base';'XX ';'XX ';'Na ';'Pa ';'Nb ';'Pb ';'P1 ';'N1 '];PeakSign=[1,1,1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,1,-1];fid=fopen(s,'r');if fid =-
matlab
function [t,buff1,buff2,comment,par]=IHSread(s);
PeakName=['I ';'II ';'III ';'IV ';'V ';'VI ';'VII ';'XX ';'NN ';
'Base';'XX ';'XX ';'Na ';'Pa ';'Nb ';'Pb ';'P1 ';'N1 '];
PeakSign=[1,1,1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,1,-1];
fid=fopen(s,'r');
if fid =-1
oddsweep=fread(fid,1024,'int32');
evensweep=fread(fid,1024,'int32');
conf=fread(fid,200,'int16');
comentarray=fread(fid,100,'uchar');
Extrafield1=fread(fid,500,'char');
ef2=fread(fid,100,'char');
nchar=ef2(1);
comment=char(ef2(2:nchar+1))';
par.Sweep=conf(6);
par.Ts=conf(7)*1e-3;
par.Int=conf(4);
ADVolts=conf(55);
ADRange=conf(56);
par.ZeroPos=conf(112);
par.Rate=conf(8)+conf(17)/1000;
par.Gain=conf(10)*1000;
% peak info
for kk=1:10
par.peaks(kk).label=conf(kk+30);
par.peaks(kk).PosSample=conf(kk+20);
par.peaks(kk).NegSample=conf(kk+60);
end;
par.ConvFactor=1e6*ADVolts/ADRange/par.Gain/par.Sweep;
buff1=2*oddsweep*par.ConvFactor;
buff2=2*evensweep*par.ConvFactor;
t=((1:1024)-par.ZeroPos)*par.Ts;
fclose(fid);
end;

matlabfunction [t,buff1,buff2,comment,par]=IHSread(s);PeakName=['I ';'II ';'III ';'IV ';'V ';'VI ';'VII ';'XX ';'NN ';'Base';'XX ';'XX ';'Na ';'Pa ';'Nb ';'Pb ';'P1 ';'N1 '];PeakSign=[1,1,1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,1,-1];fid=fopen(s,'r');if fid =-
function [t,buff1,buff2,comment,par]=IHSread(s);
%定义函数,函数名为IHSread,输入变量为s,输出变量为方括号里的几个
PeakName=['I ';'II ';'III ';'IV ';'V ';'VI ';'VII ';'XX ';'NN ';
'Base';'XX ';'XX ';'Na ';'Pa ';'Nb ';'Pb ';'P1 ';'N1 '];
%定义字符串,作为峰的名称
PeakSign=[1,1,1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,1,-1];
%
fid=fopen(s,'r');
%定义一个文件id,s是字符串,是函数的输入,应该是存了数据的文件名
%如果出错,fid返回-1
if fid =-1
%如果没出错
oddsweep=fread(fid,1024,'int32');
%从s文件中顺序读取1024个32位整数,并赋值给oddsweep
evensweep=fread(fid,1024,'int32');
%从s文件中接着顺序读取1024个32位整数,并赋值给oddsweep
conf=fread(fid,200,'int16');
%从s文件中接着顺序读取200个16位整数,并赋值给conf
comentarray=fread(fid,100,'uchar');
%从s文件中接着顺序读取100个无符号字符串,并赋值给comentaray
Extrafield1=fread(fid,500,'char');
%从s文件中接着顺序读取500个字符串,并赋值给extrafield1
ef2=fread(fid,100,'char');
%从s文件中接着顺序读取500个无符号字符串的ascii码,并赋值给ef2
nchar=ef2(1);
%将ef2的第一个值赋值给nchar
comment=char(ef2(2:nchar+1))';
%将ef2的值从第二个开始转置一下,赋值给comment,并强制形成字符串
par.Sweep=conf(6);
%结构体par的Sweep元素定义为conf的第六个元素
par.Ts=conf(7)*1e-3;
%结构体par的Ts元素定义为conf的第七个元素乘以10的-3次方
par.Int=conf(4);
%结构体par的Int元素定义为conf的第四个元素
ADVolts=conf(55);
%定义ADVolts为conf的第55个元素
ADRange=conf(56);
%定义ADRange为conf的第56个元素
par.ZeroPos=conf(112);
%结构体par的ZeroPos元素定义为conf的第112个元素
par.Rate=conf(8)+conf(17)/1000;
%结构体par的Rate元素定义为conf的第六个元素
par.Gain=conf(10)*1000;
%结构体par的Sweep元素定义为conf的第六个元素
% peak info
for kk=1:10
par.peaks(kk).label=conf(kk+30);
par.peaks(kk).PosSample=conf(kk+20);
par.peaks(kk).NegSample=conf(kk+60);
end;
%par.peaks.label赋值为conf从31开始的十个值
%par.peaks.PosSample赋值为conf从21开始的十个数
%par.peaks.NegSample赋值为conf从61开始的十个数
%下面是乘除运算了
par.ConvFactor=1e6*ADVolts/ADRange/par.Gain/par.Sweep;
buff1=2*oddsweep*par.ConvFactor;
buff2=2*evensweep*par.ConvFactor;
t=((1:1024)-par.ZeroPos)*par.Ts;
fclose(fid);
end;
这个函数主要是从一个文件读取文件
所以必须要清楚保存这个文件时的顺序

bu ying bu bu ying bu 撒娇? matlabfunction [t,buff1,buff2,comment,par]=IHSread(s);PeakName=['I ';'II ';'III ';'IV ';'V ';'VI ';'VII ';'XX ';'NN ';'Base';'XX ';'XX ';'Na ';'Pa ';'Nb ';'Pb ';'P1 ';'N1 '];PeakSign=[1,1,1,1,1,1,1,1,1,1,1,1,-1,1,-1,1,1,-1];fid=fopen(s,'r');if fid =- sorry I can’t play basketball with today I am very bu------ Ni Dou Bu Ai Wo (You Don'T Love Me) 歌词 He (speak) for half an hour bu didn't say much 用越语翻译这句话 Sao anh kh?ng t kê?em Em bu?n m quan bu [do:][fi:t][ti:][fu:t][mi:t][a:t][to:k][du:][bu:t]根据音标写词语还有把词语翻译成中文 Don't compare with others,just bu yourself.这句话有没有语病?请问各位哥哥姐姐,Don't compare with others,just bu yourself.这句话有语病吗? 英语翻译“卟准又寸哇耍COOl~卟准口`>哇吃Cu~嗒加木呢要`上Bu~揍呢喃要T人主~” Don't judge a book bu its cover麻烦问下这句什么意思,(最好是翻译成中文的谚语) She didn't post the heavy parcel.(改为被动语态) The heavy parcel _____ _____ bu her. Bạn không tin tôi,thực sự buồn是什么意思,越南语 /t/+y--/t/ /t/+y--/t/,例如meet you /d/+y--/d/,例如did you /s/+y--//,例如miss you /z/+y--//,例如was you /d/+y=/d/ asks about you /s-ts `bu-t/ 都有“” 英语翻译汉语拼音标注如下:kao wa di wa di na ta dai fan han wu wu gan lang za ze ne ku lao guo yang mei kei maikei za fan han wu fan ti lai guo han kei bu mi dei bu gan duo yai yai yai .mi dei bu gan duo ma mai my.ta tang guo na gua ta t bu/acre是什么 wo bu zhi dao yong bu man zu