App Designer help with code
Show older comments
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 Comment
Geoff Hayes
on 17 Apr 2019
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.
Answers (0)
Categories
Find more on Develop Apps Using App Designer 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!