How to run a Matlab file which uses functions from .c and .dll files?

7 vues (au cours des 30 derniers jours)
Niek
Niek le 30 Juin 2022
Commenté : Niek le 30 Juin 2022
Sittuation:I am trying to use Matlab code for estimating CAViaR-models, the code comes directly from the original authors Engle & Manganelli.See [http://www.simonemanganelli.org/Simone/Research.html under CAViaR: Conditional Autoregressive Value at Risk by Regression Quantiles (with Robert Engle), 2004] for more info.
Problem: There downloaded zip-file contains Matlab files aswell as .c and .dll files. One of the matlab files 'RQobjectiveFunction.m' calls a function SAVloop which likely refers to either the 'SAVloop.c'- or 'SAVloop.dll'-file. I receive the error message "Unrecognized function or variable 'SAVloop'." when the SAVloop function is called: VaR = SAVloop(THETA, BETA, y, VaR(1))
Question: Are there any steps I should take such that the Matlab file knows how to call the c\dll file?.

Réponse acceptée

James Tursa
James Tursa le 30 Juin 2022
Modifié(e) : James Tursa le 30 Juin 2022
It appears that this may be an older mex routine? Is there a "mexFunction" in the c file? If so, maybe you can just recompile it to produce a mex routine compatible with your current MATLAB version:
mex SAVloop.c
You will need a supported C compiler installed on your computer.
  1 commentaire
Niek
Niek le 30 Juin 2022
This solved my problem, thank you! There was indeed a mexFunction in the c file.
For anyone having a similar problem in the future who does not have a C compiler installed, I used the MinGw-w64 C/C++ compiler which can be downloaded as a Matlab Add-on.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by