I don't think there is an Origin C version of the peaks function. Here's an example OC function that uses LT's peaks(). It's meant to be called from LabTalk so the peak dataset is not destroyed on exit.int FindPks(string strData, string strPeak, int iWidth, double dHeight)
{
Dataset dsData(strData);
if( !dsData.IsValid() )
return -1;
Dataset dsPeak(strPeak);
if( dsPeak.IsValid() )
dsPeak.SetSize(0);
else
dsPeak.Create(0,1);
string strCmd;
strCmd.Format("%s=peaks(%s,%d,%f);",strPeak,strData,iWidth,dHeight);
LT_execute(strCmd);
dsPeak.Attach(strPeak);
return dsPeak.GetSize(); // return peak count
}
Mike Buess
Origin WebRing Member
Edited by - Mike Buess on 07/29/2004 4:05:46 PM