Undefined function 'extractfield' for input arguments of type 'struct' in MATLAB R2023a
23 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Stephen23
2023-3-28
编辑:Stephen23
2023-3-28
"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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!