Gistlib Logo

gistlib

write a program or script that outputs number of values in a matrix thats greater than a compared value. it must be able to take in an arbitrary size matrix. name it as "quiz 2". in matlab

main.m
function count = quiz2(matrix, compared_value)
    count = sum(matrix > compared_value, 'all');
end
100 chars
4 lines

similar matlab code snippets

how to calculate the maximum of a matrix in matlab
how to calculate the product of a matrix in matlab
how to calculate the first derivative of a function in matlab
how to calculate the derivative of a function in matlab
how to calculate the binomial distribution in matlab
how to calculate the gradient of a function in matlab
how to calculate the volume of a prism in matlab
how to calculate the area of a square in matlab
how to calculate the median of a matrix in matlab
find the slope of a set of points in matlab

related categories

matlab
programming

gistlibby LogSnag