Gistlib Logo

gistlib

how many students got a higher mark on the exam than on test #1 in matlab

main.m
% Assuming marks are stored in two arrays, examMarks and test1Marks
examMarks = [80, 90, 75, 85, 95];
test1Marks = [70, 85, 68, 80, 90];

higherMarksCount = sum(examMarks > test1Marks);
disp(['Number of students who got a higher mark on the exam than on test #1: ', num2str(higherMarksCount)]);
295 chars
7 lines

similar matlab code snippets

how to write matlab statements to sum the number of a's (grades of 90-100), b's (80-89), and c's (70-79). given the array grades=[91 85 72 78 99 83 89 93 77 92 89 90 100 78 88 76 98 76 85 92]; in matlab
creating a while loop updating values that doesnt equal mode in matlab
use the elements of an array as function arguments in matlab
generate tribonacci sequence in matlab
reverse a character array in matlab
tic-tac-toe game in matlab in matlab
how to replace each element in a array with the row of another array in matlab
make a random 100-by-100 matrix in matlab
add element to empty cell in matlab
insert code to determine the size of the times table in matlab

related categories

matlab
arrays
conditional-statements

gistlibby LogSnag