I am working on a MATLAB GUI using App Designer, though perhaps my issue is similar to guide. What I would like to do is pass the output of one callback (button) into another.

7 ビュー (過去 30 日間)
Issa
Issa 2019 年 6 月 15 日
コメント済み: TADA 2019 年 6 月 16 日
while i ma trying to run this in appdesigner
function loadmatButtonPushed(app, event)
[file,path] = uigetfile('*.mat')
app.loadmatButton= load( fullfile(path,file) )
end
i got this arror "Invalid data type. Value must be matlab.ui.control.Button or be convertible to matlab.ui.control.Button.
"

回答 (2 件)

Walter Roberson
Walter Roberson 2019 年 6 月 15 日
The above suggests to me that you have a ui control button already that has the name loadmatButton and the handle to that is stored in app.loadmatButton . But then you are trying to save the results of the load() into app.loadmatButton, which would overwrite the ui control handle
  1 件のコメント
Issa
Issa 2019 年 6 月 15 日
i want to load the matrix in the pah directory to be shown by another button, i do not know how that could be ?

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


Issa
Issa 2019 年 6 月 16 日
i solved the problem by defining a global variable in the buttons i need to share the variables between
  1 件のコメント
TADA
TADA 2019 年 6 月 16 日
Seems to me like you tackled it the wrong way.
Why isn't a simple property in app good enough?
As for your error, as Walter stated, you simply try to overwrite the button property with something not button. Simply add another property to app with a different name and set it there

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

カテゴリ

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