How to replace certain array values using if, for or while?
显示 更早的评论
I have this 45x10 array with vallues between 0 and 2.5, I want to replace those values with letters if certain conditions are being atended.
The conditions are:
If the value is greater than 1.6, it gets grade E... if the value is greater than 1 and less than 1.6, it will receive a D grade... If the value is greater than 0.63 and less than 1, it receives a grade of C... If the value is greater than 0.315 and less than 0.63, it receives a grade of B...And finally, if the value is less than 0.315, it receives an A grade.
It can also be grades between 2 and 10 following the same ones I showed earlier (E=2, D=4, C=6, B=8 and A=10), but it would be better if the letters were used.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!