You are given a cell array containing information about a number of soccer games. Each cell contains one of the following:
So if
games = {'D','D','A','H','D','H'}
then
draws = 3
552 Solvers
Solve the set of simultaneous linear equations
171 Solvers
191 Solvers
Celsius to Fahrenheit converter
280 Solvers
361 Solvers
Solution 1868534
Can someone help? I'm trying to learn how to use cellfun and I don't understand it completely.
Here's one way you can use cellfun to solve this problem. I made an anonymous function called isDraw.
isDraw = @(letter) letter=='D'
d = cellfun(isDraw,games)
draws = sum(d)