What is wrong with this if-elseif-else function
4 ビュー (過去 30 日間)
古いコメントを表示
what is wrong with it
0 件のコメント
採用された回答
James Tursa
2017 年 9 月 22 日
編集済み: James Tursa
2017 年 9 月 22 日
The main problem is this line
elseif( userWeight >= 50 )
should be this instead
elseif( userWeight <= 140 )
And then the remaining parts of the if-then-else aren't really needed. The way you have it coded now, if userWeight is 500 they will get a dosageAmount of 20 because they will match that second branch test.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Problem-Based Optimization Setup についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!