Znn3bq.jpeg
ÉÇÍ·´óѧº£Ñó¿ÆÑ§½ÓÊܵ÷¼Á
²é¿´: 1367  |  »Ø¸´: 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 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ҩѧÇóµ÷¼Á +9 RussHu 2026-04-12 10/500 2026-04-15 11:18 by xtt..
[¿¼ÑÐ] 307ÖÐÒ½¿¼Ñе÷¼Á +3 ÓÚÒÔ²ÉÞÀ 2026-04-14 3/150 2026-04-15 11:16 by xtt..
[¿¼ÑÐ] ²ÄÁÏÀà284µ÷¼Á +42 Ïë»»ÊÖ»ú²»Ïë½âÊ 2026-04-08 50/2500 2026-04-15 06:09 by åÐÒ£ÈýÀÉ
[¿¼ÑÐ] 367Çóµ÷¼Á +11 hffQAQ 2026-04-09 11/550 2026-04-14 17:48 by lhj2009
[¿¼ÑÐ] 302·ÖÇóµ÷¼Á +10 ·²ÓïÆíÔ¸ 2026-04-08 11/550 2026-04-14 16:50 by jiangguiquan11
[¿¼ÑÐ] Ò»Ö¾Ô¸»¦9£¬326ÇóÉúÎïѧµ÷¼Á +10 Áõīī 2026-04-13 10/500 2026-04-14 15:16 by zs92450
[¿¼ÑÐ] 297¹¤¿Æ£¬Çóµ÷¼Á? +13 ºÓÄÏũҵ´óѧ-ÄÜ 2026-04-12 13/650 2026-04-13 14:12 by dingyanbo1
[¿¼ÑÐ] 339Çóµ÷¼Á +4 hanwudada 2026-04-12 4/200 2026-04-13 12:03 by À¶ÔÆË¼Óê
[¿¼ÑÐ] Çóµ÷¼Á288 +7 ioodiiij 2026-04-10 9/450 2026-04-13 08:33 by Hayaay
[¿¼ÑÐ] 322Çóµ÷¼Á£¬08¹¤¿Æ +4 ½ñÌìÊǸöСºÅ 2026-04-08 4/200 2026-04-13 00:20 by baobaoye
[¿¼ÑÐ] 295·ÖÇóµ÷¼Á +13 ?ÒªÉϰ¶? 2026-04-10 13/650 2026-04-12 15:37 by laoshidan
[¿¼ÑÐ] ²ÄÁϹ¤³ÌÈÕÓÉúÇóµ÷¼Á +7 0856?µ÷¼Á 2026-04-10 7/350 2026-04-11 21:33 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 085400 328·Ö Çóµ÷¼Á +10 ιÄãÒ»¸ö´ó³È×Ó 2026-04-09 14/700 2026-04-11 19:53 by lqspecial
[¿¼ÑÐ] 0854µ÷¼Á +5 ÒôÏñµêÌý»¨¹ÄÏ· 2026-04-10 5/250 2026-04-11 10:49 by qingpingzhu
[¿¼ÑÐ] 087100³õÊÔ311Çóµ÷¼Á +4 ÈÎÑÅÇÙ 2026-04-09 4/200 2026-04-11 10:33 by zhq0425
[¿¼ÑÐ] ¹¤¿Æ273µ÷¼Á +6 X1999 2026-04-09 7/350 2026-04-11 10:23 by zhq0425
[¿¼ÑÐ] µ÷¼Á »¯Ñ§ 307 +21 73372112 2026-04-09 23/1150 2026-04-10 23:53 by wj165256
[¿¼ÑÐ] 282£¬µçÆø¹¤³Ìרҵ£¬Çóµ÷¼Á£¬²»Ìôרҵ +9 jggshjkkm 2026-04-10 9/450 2026-04-10 14:55 by ÄæË®³Ë·ç
[ÂÛÎÄͶ¸å] ÇóÖúÎÄÏ×Ô­ÎÄ 10+3 18500821399 2026-04-08 3/150 2026-04-09 16:56 by ±±¾©À³ÒðÈóÉ«
[¿¼ÑÐ] 085501»úеӢ¶þ77×Ü·Ö294Çóµ÷¼Á£¬½ÓÊÜ¿çרҵѧϰ +6 ÊØ·¨¹«ÃñØÁ¼Í 2026-04-08 6/300 2026-04-09 15:55 by wp06
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û