フィルターのクリア

How to call a function (another .m file) in MATLAB GUI?

2 ビュー (過去 30 日間)
Ekin
Ekin 2013 年 8 月 27 日
I want to call an another .m file in my main gui .m file. But when i call the function, it gives me error due to "handles." operators.
If i change "handles." operators in the .m function file, i can't get any result in gui figure.
How to fix this problem? Thanks in advance!

採用された回答

Jan
Jan 2013 年 8 月 27 日
When you get an error message, it is a good idea, to post it here. Posting the relevant part of the code allows us to understand what happens.
"handles." is not an operator, but a struct.
  2 件のコメント
Ekin
Ekin 2013 年 8 月 27 日
Well you are right. I get this error when I try to call the function:
Undefined function or variable "handles".
Error in Murthy (line 71) axes(handles.axes2);
Error in Myprogram>pushbutton1_Callback
(line 106)
qwertyu=Murthy(result);
I think i solved the problem right now. Just deleted the axes line and pasted it below button function.
Jan
Jan 2013 年 8 月 27 日
編集済み: Jan 2013 年 8 月 27 日
Or you can provide the handles struct as input to the Murthy function:
qwertyu=Murthy(result, handles);
...
function Reply = Murthy(result, handles)
...

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by