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!