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 Center および File ExchangeDevelop 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