Execution of script Faddeeva_w as a function is not supported:

5 vues (au cours des 30 derniers jours)
Thomas
Thomas le 30 Jan 2024
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?

Réponses (2)

Dyuman Joshi
Dyuman Joshi le 30 Jan 2024
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 le 30 Jan 2024
You need to first execute
Faddeeva_build
to configure the remaining functions for use with your system.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by