I wrote a code to calculate the final letter grades of students; however, I keep encountering this error whenever I run it. I know that we should use && with a scalar value however, the grades for 20 students are in a 20x1 double matrix called Final. How can I fix this issue so that it looks at each students grade and assigns it a letter. The code is :
elseif Final>=70 && Final=60 && Final=50 && Final
This thread is archived
New comments cannot be posted and votes cannot be cast
Sort by: best
What you want to do is use logical indexing.
You are watching: Operands to the || and && operators must be convertible to logical scalar values.
Op · 3y
Thank you for your help!
The double && and || are called short-circuit operators and only work on logicals.
You can do this without an if statement.
See more: 303 2Nd St San Francisco Ca 94107, 303 2Nd Street Plaza
Op · 3y
Thank you! I actually ended up using an If statement. I just changed some code before the one above.
More posts from the matlab community
Continue browsing in r/matlab
Official MATLAB subdiscoverhotmail.com
Created Aug 15, 2009
Top posts november 10th 2018Top posts of november, 2018Top posts 2018
helpdiscoverhotmail.com coinsdiscoverhotmail.com premiumdiscoverhotmail.com gifts
Back to Top