Undefined function 'extractfield' for input arguments of type 'struct' in MATLAB R2023a

조회 수: 26 (최근 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

채택된 답변

Stephen23
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.
  댓글 수: 2
Marco
Marco 2023년 3월 28일
편집: Marco 2023년 3월 28일
Thanks for the hint!
Is it working for you in 2023a? I'm just asking because i was deinstalling version 2022b before installing the new one and reinstalled all of the toolboxes while installing 2023b. I thought that in this case it would install the newest version automatically..
Update: It is now working again! Maybe i just forgot to click on the Mapping Toolbox during the installation process...
Stephen23
Stephen23 2023년 3월 28일
편집: Stephen23 2023년 3월 28일
"Is it working for you in 2023a?"
ver
----------------------------------------------------------------------------------------------------- MATLAB Version: 9.14.0.2218432 (R2023a) MATLAB License Number: 0 Operating System: Linux 5.4.233-0504233-generic #202302250651 SMP Sat Feb 25 12:26:27 UTC 2023 x86_64 Java Version: Java 1.8.0_292-b10 with AdoptOpenJDK OpenJDK 64-Bit Server VM mixed mode ----------------------------------------------------------------------------------------------------- MATLAB Version 9.14 (R2023a) Simulink Version 10.7 (R2023a) 5G Toolbox Version 2.6 (R2023a) Aerospace Blockset Version 6.0 (R2023a) Aerospace Toolbox Version 4.4 (R2023a) Antenna Toolbox Version 5.4 (R2023a) Audio Toolbox Version 3.4 (R2023a) Automated Driving Toolbox Version 3.7 (R2023a) Bioinformatics Toolbox Version 4.17 (R2023a) Bluetooth Toolbox Version 1.2 (R2023a) Communications Toolbox Version 8.0 (R2023a) Computer Vision Toolbox Version 10.4 (R2023a) Control System Toolbox Version 10.13 (R2023a) Curve Fitting Toolbox Version 3.9 (R2023a) DO Qualification Kit Version 3.15 (R2023a) DSP System Toolbox Version 9.16 (R2023a) Database Toolbox Version 11.0 (R2023a) Datafeed Toolbox Version 6.4 (R2023a) Deep Learning Toolbox Version 14.6 (R2023a) Econometrics Toolbox Version 6.2 (R2023a) Embedded Coder Version 7.10 (R2023a) Filter Design HDL Coder Version 3.1.13 (R2023a) Financial Instruments Toolbox Version 3.6 (R2023a) Financial Toolbox Version 6.5 (R2023a) Fixed-Point Designer Version 7.6 (R2023a) Fuzzy Logic Toolbox Version 3.1 (R2023a) Global Optimization Toolbox Version 4.8.1 (R2023a) HDL Coder Version 4.1 (R2023a) HDL Verifier Version 7.1 (R2023a) IEC Certification Kit Version 4.0 (R2023a) Image Acquisition Toolbox Version 6.7.1 (R2023a) Image Processing Toolbox Version 11.7 (R2023a) Industrial Communication Toolbox Version 6.2 (R2023a) Instrument Control Toolbox Version 4.8 (R2023a) LTE Toolbox Version 3.9 (R2023a) MATLAB Compiler Version 8.6 (R2023a) MATLAB Compiler SDK Version 7.2 (R2023a) MATLAB Report Generator Version 5.14 (R2023a) Mapping Toolbox Version 5.5 (R2023a) Mixed-Signal Blockset Version 2.4 (R2023a) Model Predictive Control Toolbox Version 8.1 (R2023a) Navigation Toolbox Version 2.4 (R2023a) Optimization Toolbox Version 9.5 (R2023a) Parallel Computing Toolbox Version 7.8 (R2023a) Partial Differential Equation Toolbox Version 3.10 (R2023a) Phased Array System Toolbox Version 5.0 (R2023a) Powertrain Blockset Version 2.0 (R2023a) Predictive Maintenance Toolbox Version 2.7 (R2023a) RF Blockset Version 8.5 (R2023a) RF Toolbox Version 4.5 (R2023a) Requirements Toolbox Version 2.2 (R2023a) Risk Management Toolbox Version 2.2 (R2023a) Robotics System Toolbox Version 4.2 (R2023a) Robust Control Toolbox Version 6.11.3 (R2023a) Sensor Fusion and Tracking Toolbox Version 2.5 (R2023a) SerDes Toolbox Version 3.0 (R2023a) Signal Processing Toolbox Version 9.2 (R2023a) SimBiology Version 6.4.1 (R2023a) SimEvents Version 5.14 (R2023a) Simscape Version 5.5 (R2023a) Simscape Driveline Version 3.7 (R2023a) Simscape Electrical Version 7.9 (R2023a) Simscape Fluids Version 3.6 (R2023a) Simscape Multibody Version 7.7 (R2023a) Simulink 3D Animation Version 9.6 (R2023a) Simulink Check Version 6.2 (R2023a) Simulink Code Inspector Version 4.3 (R2023a) Simulink Coder Version 9.9 (R2023a) Simulink Control Design Version 7.0 (R2023a) Simulink Coverage Version 5.6 (R2023a) Simulink Design Optimization Version 3.13 (R2023a) Simulink Design Verifier Version 4.9 (R2023a) Simulink PLC Coder Version 3.8 (R2023a) Simulink Real-Time Version 8.2 (R2023a) Simulink Report Generator Version 5.14 (R2023a) Simulink Test Version 3.8 (R2023a) Stateflow Version 10.8 (R2023a) Statistics and Machine Learning Toolbox Version 12.5 (R2023a) Symbolic Math Toolbox Version 9.3 (R2023a) System Identification Toolbox Version 10.1 (R2023a) Text Analytics Toolbox Version 1.10 (R2023a) Vehicle Dynamics Blockset Version 2.0 (R2023a) Vehicle Network Toolbox Version 5.4 (R2023a) Vision HDL Toolbox Version 2.7 (R2023a) WLAN Toolbox Version 3.6 (R2023a) Wavelet Toolbox Version 6.3 (R2023a) Wireless HDL Toolbox Version 2.6 (R2023a)
S = dir('..');
extractfield(S,'name')
ans = 1×3 cell array
{'.'} {'..'} {'mss.system.HH9h7Z'}
which extractfield -all
/MATLAB/toolbox/map/map/extractfield.m

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by