how can i take the values from edit_text of gui to function

1 回表示 (過去 30 日間)
esat gulhan
esat gulhan 2019 年 12 月 30 日
コメント済み: Image Analyst 2019 年 12 月 31 日
I am writing a program for fluid kinematics. It is working, but i want to show in matlab gui.
function ut=u(x,y);
ut=3*x+y
end
it accepts
function ut=u(x,y);
ut=(get(handles.edit11,'String'))
end
but it does not accept it.
i want to get values from edit_text. Can you help for this?
  3 件のコメント
esat gulhan
esat gulhan 2019 年 12 月 30 日
It says "Undefined variable "handles" or class "handles.ugui"." when i put
Jason
Jason 2019 年 12 月 30 日
Put handles as an argument in your function.

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

採用された回答

Image Analyst
Image Analyst 2019 年 12 月 30 日
function ut = u(handles, x, y)
ut = handles.edit11.String
evalc(ut)
end
  2 件のコメント
Jason
Jason 2019 年 12 月 31 日
Shouldn't there be a get ...
get(handles.edit11,'String')
Image Analyst
Image Analyst 2019 年 12 月 31 日
No - that's the old fashioned way - pre release 2014b. The newer way is like the object oriented programming (OOP) way that all modern languages use now. I'm using the new/current OOP way.

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

その他の回答 (1 件)

esat gulhan
esat gulhan 2019 年 12 月 31 日
It is definetly good way. (practical). it works...thanks

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by