Can someone figure out whats wrong with my code?

1 回表示 (過去 30 日間)
Calvin calvis
Calvin calvis 2018 年 4 月 26 日
編集済み: Calvin calvis 2018 年 4 月 27 日
I'm trying to develope a code for my GUI,but when I try to run this error pop out
*Field assignment to a non-structure array object.
Error in PROJECT_2>btnRUN_Callback (line 126) Out(1).Loc='(0)Normal ';
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in PROJECT_2 (line 42) gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)PROJECT_2('btnRUN_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback.*
Attached files are my code,txt format and GUI program,thanks!
  1 件のコメント
Calvin calvis
Calvin calvis 2018 年 4 月 26 日
Here's the GUI progress so far.

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

回答 (1 件)

Ahmet Cecen
Ahmet Cecen 2018 年 4 月 26 日
You are a call to a function like this:
[Out]=UDF_Uncontrol(E0,y0,yc2,h,q2);
which returns an "Out" variable that is not a struct array apparently. Then you try to modify the same variable immediately after that call as if it is a struct:
Out(1).Loc='(0)Normal
Either make sure Out from the first function is a struct array, or rename the second Out something else like OutX.
  1 件のコメント
Calvin calvis
Calvin calvis 2018 年 4 月 27 日
編集済み: Calvin calvis 2018 年 4 月 27 日
unfortunately it doesn't work for renaming the second Out.

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

カテゴリ

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