Execution of script Faddeeva_w as a function is not supported:

조회 수: 5 (최근 30일)
Thomas
Thomas 2024년 1월 30일
답변: Walter Roberson 2024년 1월 30일
Tryying to apply Voigt Model Fit generates the error
[estimates, model] = voigtfit(x, y, initGuess, peakBounds)
Execution of script Faddeeva_w as a function is not supported:
C:\Users\t.pagel\AppData\Roaming\MathWorks\MATLAB Add-Ons\Collections\Faddeeva Package_ complex error functions\Faddeeva_w.m
Error in voigtfit>voigt (line 129)
vp = (1/(sig*sqrt(2*pi))) * real(Faddeeva_w(z)); % Get Voigt from Faddeeva fn.
Error in voigtfit>calc_model_from_nlparams (line 162)
A(:,k) = voigt(x, nlpVec(3*k-2), nlpVec(3*k-1), nlpVec(3*k));
Error in voigtfit (line 80)
peaksCell = calc_model_from_nlparams(initGuess, xdata, ydata);
the model has nbeen added correctly to matlab.
What is the problem?

답변 (2개)

Dyuman Joshi
Dyuman Joshi 2024년 1월 30일
You have defined the file "Faddeeva_w " as a script.
But you are trying to call it as a function i.e. by providing an input (as the error has highligted), which is not allowed.
Modify the file to define it as a function which accepts an input and provides output(s) as required.
For reference, see - function.

Walter Roberson
Walter Roberson 2024년 1월 30일
You need to first execute
Faddeeva_build
to configure the remaining functions for use with your system.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by