How do you write a code in app designer in order to make a random integers of multiple edittable text? I created this code but I'm afraid this doesn't work.
1 次查看(过去 30 天)
显示 更早的评论
a=randi(1,1);
b=randi(1,1);
c=randi(1,1);
d=randi(1,1);
e=randi(1,1);
f=randi(1,1);
g=randi(1,1);
h=randi(1,1);
a=app.EditField.Value;
b=app.EditField_2.Value;
c=app.EditField_3.Value;
d=app.EditField_4.Value;
e=app.EditField_5.Value;
f=app.EditField_6.Value;
g=app.EditField_7.Value;
h=app.EditField_8.Value;
0 个评论
采纳的回答
Cris LaPierre
2021-1-7
If I understand your question correctly, you want to make the value in your numeric edit field a random value.
Remember that in MATLAB, the value to the left of the equals sign is assigned the value of what is to the right of the equals sign. In order the change the value of your edit field, put that on the left, and put the new value to the right.
app.EditField.Value=randi(1,1);
app.EditField_2.Value=randi(1,1);
...
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!