I created a matlab gui to load some text files and process the data it contains. The GUI works all fine, but whenever i load the data, it gives me the following errors
>> guide
Undefined function or variable 'ProcessData_momentum'.
Error in
matlab.graphics.internal.figfile.FigFile / read> @ (hObject, eventdata) ProcessData_momentum ('Momentum_CreateFcn', hObject, eventdata, guidata (hObject))
Although there is no function or variable in my gui file naming "ProcessData_momentum". The gui still runs fine and does not give me anymore errors for subsequent uses, but whenever I first time open the gui, this error msg is still there. I am unable to find the source of this error. Any help is highly appreciated.

 採用された回答

Walter Roberson
Walter Roberson 2020 年 7 月 30 日

0 投票

The way that particular error arose is that at one point the GUI was named ProcessData_momentum but the GUI was renamed by some means other than opening it in GUIDE and asking GUIDE to "save as".
Typically the easiest way to fix a problem such as this is to rename the .m and .fig back to ProcessData_momentum and then open it in GUIDE and tell GUIDE to save it under the new name you want.
This is not the only solution, but it is by far the easiest solution. In order to use the other solutions, you have to know your way around the property inspector to find the properties that have the problem and patch them to repair the problem.

9 件のコメント

Sumera Yamin
Sumera Yamin 2020 年 7 月 31 日
many thanks for your answer, but unfortunately, the error is still there, it does not go away.
Walter Roberson
Walter Roberson 2020 年 7 月 31 日
if you attach your m file and fig then I will try to fix it.
Sumera Yamin
Sumera Yamin 2020 年 7 月 31 日
Hi, please see the attached files. Many thanks for your help.
  • SolenoidMisalignment_GUIscript.m is my function code.
Walter Roberson
Walter Roberson 2020 年 7 月 31 日
Revised files attached. The changes were not large, but they would not have been easy to pin down for someone who was not experienced in this area.
Interestingly, this exposed a bug in my analysis program. I patched my program, but I can tell I am going to be tweaking the fix in the future.
Sumera Yamin
Sumera Yamin 2020 年 7 月 31 日
the code is error free now, thank you very much. This was a very big help for me. May i ask you another question related to same analysis script. I am using "lsqr" to solve system of matrices. Now if the analysis gives me output as "lsqr converged at iteration 2 to a solution with relative residual 0.013." As far as i understand, this residual value is large, does this mean that system does not have a solution? And if i have to give error in solution, how will i calculate the error/interpret the residual?
Walter Roberson
Walter Roberson 2020 年 8 月 1 日
I do not know? I would suggest checking it with another minimizer.
Sumera Yamin
Sumera Yamin 2020 年 8 月 1 日
ok. Thank you
Sumera Yamin
Sumera Yamin 2020 年 8 月 2 日
I have another question related to same scripts. How can i ask my gui to ignore the rows in the uploaded text files with inf?
Walter Roberson
Walter Roberson 2020 年 8 月 2 日
A = YourArray;
A(~isfinite(A)) = nan;
A = rmmissing(A);
And then work with A.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by