Undefined function 'extractfield' for input arguments of type 'struct' in MATLAB R2023a
15 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Stephen23
on 28 Mar 2023
Edited: Stephen23
on 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.
2 Comments
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!