How to create a 'fittype' calling PDE toolbox function

2 ビュー (過去 30 日間)
Laurent Lombez
Laurent Lombez 2021 年 2 月 11 日
I'd like to call a function that solves PDE to fit a surface named 'surface2'. Here -in three lignes- what I have guessed so far (all variables are previously defined):
ft=fittype(@(Tau,D,Rrad,x,t) fct_fit(Tau,D,Rrad,ni,FWHM,x,t),'independent',{'x','t'},'coefficients',{'Tau','D','Rrad'})
[tmp1 ,tmp2, tmp3]=prepareSurfaceData(x,t,surface2);
[surffit,strt] = fit([tmp1 ,tmp2],tmp3,ft)
Important point : if i run ony: fct_fit(ni,FWHM,Tau,D,Rrad,x,t) it is working well and it gives me the simulated matrix with the input paramters
BUT, if I run the full line 'ft' for the fittype it tells me 'Expression fct_fit(Tau,D,Rrad,ni,FWHM,x,t) is not a valid MATLAB expression, has non-scalar coefficients, or cannot be evaluated:
Error while trying to evaluate FITTYPE function :
The entries of TSPAN must be strictly increasing.
Also things i have tried (still same things): adding a z dependent variable ; chnaging the order fct_fit(ni,FWHM,Tau,D,Rrad,x,t) by fct_fit(Tau,D,Rrad,ni,FWHM,x,t)
Thanks in advance for your help

回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by