App Designer error: "unable to add component. Not enough input arguments"

조회 수: 10 (최근 30일)
I created a new blank App in App Designer. When I drag the Axes component onto the UI, after a few seconds, the following error pops up:
unable to add component
matlab.ui.control.UIAxes. Component creation failed with error:
Not enough input arguments. 
In the code view, there is also a missing ‘CodeName’ property on ‘UIAxes’. How do I resolve this error?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2023년 1월 6일
The issue is related to missing ‘DesignTimeProperties’ on a component, which causes the code to have components with no name. 
Please check if you have a ‘DefaultAxesCreateFcn’ or ‘DefaultFigureCreateFcn’ on groot. Sometimes these are set in the "startup.m" file.
As a workaround, please follow the following steps:
  1. Set breakpoint in ‘FileReader.m’ where MAT-file is loaded. 
  2. Open app in App Designer.
  3. When paused, query figure for any components with 'CreateFcn' and set the CreateFcn on those components back to [] using the following command: 
    get(fig, '-not', 'CreateFcn', [])
  4. Delete any components with no DesignTimeProperties using the following command:
    delete(findobj(fig, '-not', '-property', 'DesignTimeProperties'))
  5. Continue and save app from App Designer.
  6. Reopen the app to verify app opens fine.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by