Difference in behavior of Dashboard Push Button and App designer Button (matlab.ui.control.Button) how to make it work?
Show older comments
I am using 2017b.
I created GUI panel in Simulink model using Dashboard blocks.
Push Button I used has behavior as : when I push it , its value is 1, after release its value is zero.
I upgraded my panel using App Designer.
In app designer I am using push button for same purpose.
When I tried to write code as below for push button callback
function ButtonPushed(app, event)
value = app.Button.Value;
if value==1
set_param('SampleModel/Constant','Value', num2str(value))
else
valuezero=0;
set_param('SampleModel/Constant','Value', num2str(valuezero))
end
end
I get error as :No appropriate method, property, or field 'Value' for class 'matlab.ui.control.Button'.
Yes there is State Button : But I am using it for different purpose i.e. press to keep value 1 , press again to make value 0.
I tried to set global variable on pushbutton call back. but i dont have option to clear it.
tried to check in existing topics regarding use of push button but its of no use.
Any suggessions ?
Accepted Answer
More Answers (0)
Categories
Find more on Model, Block, and Port Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!