Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I am trying to make data/variables that i can call in different functions in a GUI

1 回表示 (過去 30 日間)
nnaeem
nnaeem 2016 年 8 月 18 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am using a push button in a GUI to connect to an fpga which uses a an api to establish connections and communication. This part works, but when i need to call the variables created by the api in another function it says those variables don't exist. I have tried declaring the variables as
...
handles.myvariable1 = x;
handles.myvariable2 = y;
guidata(hObject,handles)
...
in the function that creates them but this still doesn't allow me to access them in other parts of the GUI. I'm not sure if this is relevant but the code uses the .NET framework to establish communication to the fpga. I'm just trying to figure out way so that these functions don't get lost when i run a different part of the GUI.
  1 件のコメント
Geoff Hayes
Geoff Hayes 2016 年 8 月 21 日
nnaeem - is the above code in your pushbutton callback? In the other parts of your code (presumably the other callbacks), how are you trying to access these variables? Please clarify and post code where necessary especially as to the need to call the variables created by the api in another function. Where and what is this function?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by