Maylis
Gold Member
 945
 49
1. The problem statement, all variables and given/known data
Hello, I am working on problems 614 on the attached PDF. Don't be scared off, they are just one line of code each. I got number 6 correct, and I got partial credit on 7 and 8, but I am trying to figure out why it is not right.
2. Relevant equations
3. The attempt at a solution
Here is the code for 6, which is correct.
7)
I run the autograder and get the error message:
8)
I get the following error for number 8
So I know the autograder runs for about 5 values of sNum. My code works for some of the values of sNum, but not all. I don't understand why these codes are not valid for all values of sNum?
This is my english translation of the code, I want to know if I am understanding this correctly. I will use #6 as my example since I got full credit for that problem.
means the maximum grade of a particular student (sNum) on every exam (:) is less than or equal to the minimum grade of all other students on all other exams (min(Grades(:,.
Edit: Apparently the answer lies in the fact that I needed to change the >= to > for (7), and < to <= for (8), but I don't see exactly why. The signs are confusing the heck out of me
Here are the new correct answers
And here is (10)
It's now at the point where I am just switching mins, max, and the direction of the inequality symbol as well as tacking on an = until I get it right. I am missing something fundamental and must not be comprehending the questions correctly. Ideally I should be able to read the question and know which way to put the signs and whether or not to have an equal in the inequality (choosing between ≤ or <, etc)
Hello, I am working on problems 614 on the attached PDF. Don't be scared off, they are just one line of code each. I got number 6 correct, and I got partial credit on 7 and 8, but I am trying to figure out why it is not right.
2. Relevant equations
3. The attempt at a solution
Here is the code for 6, which is correct.
Code:
everLowest = max(Grades(sNum,:) <= min(Grades(:,:)));
Code:
neverLowest = min(Grades(sNum,:) >= min(Grades(:,:)));
Code:
Problem 7: 3/5
*the value of neverLowest is incorrect for the variables: sNum = 27;
Incompatible logical variables
*the value of neverLowest is incorrect for the variables: sNum = 77;
Incompatible logical variables
Code:
alwaysLowest = min(Grades(sNum,:) < min(Grades(:,:)));
Code:
Problem 8: 4/5
*the value of alwaysLowest is incorrect for the variables: sNum = 112;
Incompatible logical variables
This is my english translation of the code, I want to know if I am understanding this correctly. I will use #6 as my example since I got full credit for that problem.
Code:
everLowest = max(Grades(sNum,:) <= min(Grades(:,:)));
Edit: Apparently the answer lies in the fact that I needed to change the >= to > for (7), and < to <= for (8), but I don't see exactly why. The signs are confusing the heck out of me
Here are the new correct answers
Code:
7) neverLowest = min(Grades(sNum,:) > min(Grades(:,:)));
8) alwaysLowest = min(Grades(sNum,:) <= min(Grades(:,:)));
9) everHighest = max(Grades(sNum,:) >= max(Grades(:,:)));
Code:
neverHighest = max(Grades(sNum,:) <= max(Grades(:,:)));
Problem 10: 4/5
*the value of neverHighest is incorrect for the variables: sNum = 18;
Incompatible logical variables
Attachments

22.5 KB Views: 94
Last edited: