²é¿´: 1353  |  »Ø¸´: 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 µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ÉúÎïѧѧ˶Çóµ÷¼Á +7 СÑò˯×ÅÁË? 2026-03-23 10/500 2026-03-25 02:24 by Çå·ç·÷Ñï¡£ m
[¿¼ÑÐ] ¿¼Ñе÷¼Á +4 ºôºô£¿~+123456 2026-03-24 4/200 2026-03-24 23:16 by barlinike
[¿¼ÑÐ] 08¹¤Ñ§µ÷¼Á +12 Óû§573181 2026-03-20 17/850 2026-03-24 21:45 by ·¬ÇÑìÀÁËÎ÷ºìÊÁ
[¿¼ÑÐ] 0854AI CV·½ÏòÕÐÊÕµ÷¼Á +3 ÕÂСÓã567 2026-03-23 3/150 2026-03-24 20:25 by Íô£¡£¿£¡
[¿¼ÑÐ] Ò»Ö¾Ô¸±±»¯315 Çóµ÷¼Á +3 akrrain 2026-03-24 3/150 2026-03-24 19:35 by ÁËÁËÁËÁË¡£¡£
[¿¼ÑÐ] 306Çó0703µ÷¼ÁÒ»Ö¾Ô¸»ªÖÐʦ·¶ +10 Ö½Óãly 2026-03-21 11/550 2026-03-24 17:22 by qingfeng258
[¿¼ÑÐ] 305·ÖÇóµ÷¼Á£¨Ê³Æ·¹¤³Ì£© +5 Sxy112 2026-03-21 7/350 2026-03-24 12:27 by 544594351
[¿¼ÑÐ] 276Çóµ÷¼Á¡£ÓаëÄêµç³ØºÍ°ëÄê¸ß·Ö×Óʵϰ¾­Àú +9 ²ÄÁÏѧ257Çóµ÷¼Á 2026-03-23 10/500 2026-03-24 07:36 by wangy0907
[¿¼ÑÐ] 335Çóµ÷¼Á +4 yuyuÓî 2026-03-23 5/250 2026-03-23 23:49 by Txy@872106
[¿¼ÑÐ] Çóµ÷¼Á +7 Ê®Èý¼ÓÓÍ 2026-03-21 7/350 2026-03-23 23:48 by ÈÈÇéɳĮ
[¿¼ÑÐ] ¹¤¿Æ0856Çóµ÷¼Á +5 ãåÎö͡͡ 2026-03-21 5/250 2026-03-23 17:56 by º£ÉªÞ±-
[¿¼ÑÐ] 291 Çóµ÷¼Á +4 »¯¹¤2026½ì±ÏÒµÉ 2026-03-21 5/250 2026-03-23 16:46 by »¯¹¤2026½ì±ÏÒµÉ
[¿¼ÑÐ] 316Çóµ÷¼Á +7 ÁºÜçö© 2026-03-19 7/350 2026-03-23 16:21 by lingjue
[¿¼ÑÐ] Ò»Ö¾Ô¸070300Õã´ó»¯Ñ§358·Ö£¬Çóµ÷¼Á£¡ +4 ËÖËÖÓã.. 2026-03-21 4/200 2026-03-23 08:12 by Iveryant
[¿¼ÑÐ] 311Çóµ÷¼Á +3 26ÑÐ0 2026-03-20 3/150 2026-03-22 14:46 by ColorlessPI
[¿¼ÑÐ] 269ר˶Çóµ÷¼Á +6 ½ð¶÷±´ 2026-03-21 6/300 2026-03-22 14:31 by ColorlessPI
[¿¼ÑÐ] 313Çóµ÷¼Á +4 ËÁÈþ·¡Ò¼22 2026-03-19 4/200 2026-03-21 17:33 by ColorlessPI
[¿¼ÑÐ] 085601µ÷¼Á 358·Ö +3 zzzzggh 2026-03-20 4/200 2026-03-21 10:21 by luoyongfeng
[¿¼ÑÐ] Ò»Ö¾Ô¸Äϲý´óѧ£¬327·Ö£¬²ÄÁÏÓ뻯¹¤085600 +9 Ncdx123456 2026-03-19 9/450 2026-03-20 23:41 by lovewei0727
[¿¼ÑÐ] Çóµ÷¼Á +3 eation27 2026-03-20 3/150 2026-03-20 19:32 by JourneyLucky
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û