App Designer help with code
显示 更早的评论
I am attempting to make a march madness calculator using Matlab app designer as my final project in school and I am not succeeding in this task. I have multiple criteria for each team like defense, offense, coaching, etc..
each criteria is broken into 4 sections, for example offense, if a team scores 50-60 points per game on average they will be given a value of 1 for offense, if 61-70 a value of two and so on through 90.
then each criteria will be added for both teams and whichever team has the higher "score" wins
global x
if app.Seed1.Value==1-4
x=4;
elseif app.Seed1.Value==5-8
x=3;
elseif app.Seed1.Value==9-12
x=2;
elseif app.Seed1.Value==13-16
x=1;
end
I need this value of x to be able to be included in the final team's score calculation as well as the other criteria end values.
1 个评论
Geoff Hayes
2019-4-17
Michael - what is the intent of the line (and similar)
if app.Seed1.Value==1-4
Are you trying to say instead
if app.Seed1.Value >= 1 && app.Seed1.Value <= 4
x = 4;
end
where [1,4] is an interval. Also, it isn't clear to me where the above code resides but I suspect that you can avoid using a global variable to store the x value.
回答(0 个)
类别
在 帮助中心 和 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!