Undefined function 'extractfield' for input arguments of type 'struct' in MATLAB R2023a
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello Guys,
i just wanted to use the extractfield function in MATLAB as i used to do it yesterday. After upgrading from Version 2022b to 2023a today morning, it gives me an error in the exact same code which was running perfectly yesterday.
Undefined function 'extractfield' for input arguments of type 'struct'.
Does anyone else have this error with the new Version? Is there maybe a new function in 2023a for extracting information out of a struct?
Greetings
0 commentaires
Réponse acceptée
Stephen23
le 28 Mar 2023
Modifié(e) : Stephen23
le 28 Mar 2023
"After upgrading from Version 2022b to 2023a today morning, it gives me an error in the exact same code which was running perfectly yesterday."
Most likely because you have the Mapping Toolbox installed in the old version, but you did not install it in the new version. The function EXTRACTFIELD is part of the Mapping Toolbox:
"Is there maybe a new function in 2023a for extracting information out of a struct?"
Nope, because EXTRACTFIELD still works just fine. Of course you could use GETFIELD or dynamic fieldnames and some basic concatenation, which will do much the same thing. For example, where S is your structure array:
F = name of the field that you want
A = [S.(F)];
Which is basically what EXTRACTFIELD does inside anyway.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!