²é¿´: 1354  |  »Ø¸´: 1

agnes7777

Òø³æ (³õÈëÎÄ̳)

[ÇóÖú] Çë½Ì´ó¼ÒʹÓà OriginLab ×öFitting with Convolution ÎÞ·¨Fitting with compiling ÒÑÓÐ1È˲ÎÓë

   ¸ú×Åhttps://www.originlab.com/doc/Tutorials/Fitting-Convolution Fitting with Convolution°Ñ´úÂ뿽Èëºó£¬ Ìáʾ´íÎó

Linking...
Done!
compiling...
_nlfFitConv.fit
.......TMP\OriginC\NLSF\_nlfFitConv.fit(42) :Error, Member's access requires struct/class type.
.......TMP\OriginC\NLSF\_nlfFitConv.fit(42) :Error, error(s) found in compiling method
.......TMP\OriginC\NLSF\_nlfFitConv.fit(42) :Error, general compile error
.......TMP\OriginC\NLSF\_nlfFitConv.fit(29) :Error, error(s) found in compiling function _nlsfFitConv


Compile Failed!

Çó´óÉñ°ïæ лл

---------------------------------------------
CODE:
   #pragma warning(error : 15618)
#include <origin.h>
// Header files need to be included
#include <ONLSF.H>
#include <fft_utils.h>
//
//
void _nlsfTestConv(
// Fit Parameter(s):
double y0, double A, double t,
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
{
        // Beginning of editable part       
        NLFitContext *pCtxt = Project.GetNLFitContext();
        Worksheet wks;
        DataRange dr;
        int c1,c2;
        dr = pCtxt->GetSourceDataRange(); //Get the source data range
        dr.GetRange(wks, c1, c2);  //Get the source data worksheet
        if ( pCtxt )
        {       
                // Vector for the output signal in each iteration.
                static vector vSignal;
                // If parameters were updated, we will recalculate the convolution result.
                BOOL bIsNewParamValues = pCtxt->IsNewParamValues();
                if ( bIsNewParamValues )
                {
                        // Read sampling and response data from worksheet.
                        Dataset dsSampling(wks, 0);
                        Dataset dsResponse(wks, 2);
                        int iSize = dsSampling.GetSize();
                       
                        vector vResponse, vSample;
                       
                        vResponse = dsResponse;
                        vSample = dsSampling;

                        vSignal.SetSize(iSize);
                        vResponse.SetSize(iSize);
                        vSample.SetSize(iSize);
                       
                        // Compute the exponential decay curve
                        vSignal = A * exp( -t*vSample );
                        // Perform convolution
                        int iRet = fft_fft_convolution(iSize, vSignal, vResponse);
                        //Correct the convolution by multiplying the sampling interval
                        vSignal = (vSample[1]-vSample[0])*vSignal;

       
                }
               
                NLSFCURRINFO    stCurrInfo;
                pCtxt->GetFitCurrInfo(&stCurrInfo);
                // Get the data index for the iteration
                int nCurrentIndex = stCurrInfo.nCurrDataIndex;
                // Get the evaluated y value
                y = vSignal[nCurrentIndex] + y0;
                // For compile the function, since we haven't use x here.
                x;
        }
        // End of editable part
}

[ Last edited by jjdg on 2018-2-19 at 08:48 ]
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

dingd

Ìú¸Ëľ³æ (Ö°Òµ×÷¼Ò)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
jjdg: ½ð±Ò+1, ¸Ðл²ÎÓë 2018-02-19 08:48:14
ÄâºÏÎÊÌâÍÆ¼ö»»ÓÃ1stOpt£¬±ÈOriginÒ×Óã¬Ð§¹ûÒ²¸üºÃ¡£
2Â¥2018-02-17 10:08:35
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ agnes7777 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ÍøÂç¿Õ¼ä°²È«0839Õе÷¼Á +3 w320357296 2026-03-25 5/250 2026-03-25 15:31 by w320357296
[¿¼ÑÐ] 274Çóµ÷¼Á +7 ¹Ë¾ÅóÏҪǫÐé 2026-03-24 7/350 2026-03-25 15:18 by baoball
[¿¼ÑÐ] ÉúÎïѧѧ˶Çóµ÷¼Á +7 СÑò˯×ÅÁË? 2026-03-23 10/500 2026-03-25 02:24 by Çå·ç·÷Ñï¡£ m
[¿¼ÑÐ] ÕÐ08¿¼Êýѧ +7 laoshidan 2026-03-20 16/800 2026-03-24 17:52 by ÎÚÀ­¶ùɽÂö
[¿¼²©] É격26Äê +4 °Ë6°Ë68 2026-03-19 4/200 2026-03-24 15:49 by СBenºÇºÇ
[¿¼ÑÐ] Çóµ÷¼Á +7 Ê®Èý¼ÓÓÍ 2026-03-21 7/350 2026-03-23 23:48 by ÈÈÇéɳĮ
[¿¼ÑÐ] ÉúÎïѧһ־Ը985£¬·ÖÊý349Çóµ÷¼Á +6 zxts12 2026-03-21 9/450 2026-03-23 18:37 by macy2011
[ÂÛÎÄͶ¸å] ¼±·¢ºËÐÄÆÚ¿¯ÂÛÎÄ +3 ÏÍ´ïÎʽò 2026-03-23 5/250 2026-03-23 17:13 by ÃÃ×Ó²»ºÃÈÇ
[¿¼ÑÐ] 291 Çóµ÷¼Á +4 »¯¹¤2026½ì±ÏÒµÉ 2026-03-21 5/250 2026-03-23 16:46 by »¯¹¤2026½ì±ÏÒµÉ
[¿¼ÑÐ] 323Çóµ÷¼Á +6 ÍÝСͰ 2026-03-18 6/300 2026-03-23 00:29 by king123£¡
[¿¼ÑÐ] 293Çóµ÷¼Á +3 ÌÎÌÎWjt 2026-03-22 5/250 2026-03-22 22:21 by jiangpengfei
[¿¼ÑÐ] 306Çóµ÷¼Á +5 À´ºÃÔËÀ´À´À´ 2026-03-22 5/250 2026-03-22 16:17 by BruceLiu320
[¿¼ÑÐ] 324Çóµ÷¼Á +6 luckyѽѽѽѼ 2026-03-20 6/300 2026-03-22 16:01 by ColorlessPI
[¿¼ÑÐ] 269ר˶Çóµ÷¼Á +6 ½ð¶÷±´ 2026-03-21 6/300 2026-03-22 14:31 by ColorlessPI
[¿¼ÑÐ] ²ÄÁÏÓ뻯¹¤£¨0856£©304ÇóBÇøµ÷¼Á +3 Çñgl 2026-03-20 7/350 2026-03-21 19:05 by 15709483992
[¿¼ÑÐ] 0703»¯Ñ§297Çóµ÷¼Á +3 Daisy¡î 2026-03-20 3/150 2026-03-21 17:45 by ColorlessPI
[¿¼ÑÐ] 296Çóµ÷¼Á +4 www_q 2026-03-20 4/200 2026-03-21 17:26 by ѧԱ8dgXkO
[¿¼ÑÐ] 0805²ÄÁÏ320Çóµ÷¼Á +3 ÉÎïÓï 2026-03-20 3/150 2026-03-21 15:46 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] Çóµ÷¼Á +3 eation27 2026-03-20 3/150 2026-03-20 19:32 by JourneyLucky
[¿¼ÑÐ] 086500 325 Çóµ÷¼Á +3 Áì´øÐ¡ÐÜ 2026-03-19 3/150 2026-03-20 18:38 by ¾¡Ë´Ò¢1
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û