Migrating GUI to MATLAB App Designer with GUIDE

3 ビュー (過去 30 日間)
Ashleigh Reid
Ashleigh Reid 2021 年 7 月 21 日
回答済み: prabhat kumar sharma 2024 年 6 月 6 日
Hi,
I'm trying to migrate a MATLAB GUI to MATLAB App Designer with GUIDE. I managed to migrate the GUI over however, I can't seem to get the app working as there's an 'Error in InitializeGui. I found the GUI online and the code can be found here: https://uk.mathworks.com/matlabcentral/fileexchange/93395-afdaq?s_tid=srchtitle
Any help is appreciated.
  2 件のコメント
Geoff Hayes
Geoff Hayes 2021 年 7 月 21 日
Ashleigh - you may want to include the full error message and the code for the new GUI.
Ashleigh Reid
Ashleigh Reid 2021 年 7 月 21 日
The error messages recieved:
Cannot find an exact (case-sensitive) match for 'AfDaq'
The closest match is: Afdaq in C:\Users\44750\Downloads\github_repo (2)\Afdaq.m
Error in InitializeGui (line 47)
AfDaq('checkbox_scalingFunction_Callback',handles.checkbox_scalingFunction, eventdata, handles);
Error in Afdaq_App (line 1927)
runStartupFcn(app, @(app)AfDaq_OpeningFcn(app, varargin{:}))
I've attached the file with the code due to the fact the lines of code exceed the number of characters aloud.
Kind Regards

サインインしてコメントする。

回答 (1 件)

prabhat kumar sharma
prabhat kumar sharma 2024 年 6 月 6 日
Hi Ashleigh,
The error is due to a case sensitivity issue with the file name. MATLAB is case-sensitive and cannot find AfDaq because the actual file is named Afdaq.m (with a lowercase d). To fix this:
  1. Rename the file to match the exact case used in your code (AfDaq.m), or
  2. Update your code to match the file's case (Afdaq).
- Verify the Function Call: The error message points to a specific line in your InitializeGui function where it attempts to call AfDaq:
AfDaq('checkbox_scalingFunction_Callback',handles.checkbox_scalingFunction, eventdata, handles);
After resolving the case sensitivity issue, ensure that this function call is appropriate and that Afdaq.m (or AfDaq.m, depending on your correction) is designed to be called this way. If Afdaq.m is a script and not a function, you might need to restructure your approach since scripts cannot accept input arguments or be called in this manner.
This should resolve the error you're encountering.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by