In app designer, I have a random number generated that is assigned to a variable. If the number is 1, I want the user to be able to choose the value of this variable: 1 or 11
if p1 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% I need the code to pause here in app designer, ask the
% user for input then assign that input to p1
p1 = app.AceValueEditField.Value
elseif p2 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% Same as above here
p2 = app.AceValueEditField.Value
else
p1 = p1;
p2 = p2;
endif p1 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% I need the code to pause here in app designer, ask the
% user for input then assign that input to p1
p1 = app.AceValueEditField.Value
elseif p2 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% Same as above here
p2 = app.AceValueEditField.Value
else
p1 = p1;
p2 = p2;
end if p1 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% I need the code to pause here in app designer, ask the
% user for input then assign that input to p1
p1 = app.AceValueEditField.Value
elseif p2 == 1
app.EditField.Value = ‘You have drawn an ace! Please enter a value of 1 or 11 below.’
% Same as above here
p2 = app.AceValueEditField.Value
else
p1 = p1;
p2 = p2;
end appdesigner MATLAB Answers — New Questions