You can check if a cell contains the number 2 in MATLAB by converting the cell to a string array and then using the contains
function. Here is an example:
main.m141 chars9 lines
This will return a logical array where 1
means that the corresponding element contains the number 2 and 0
means that it does not.
gistlibby LogSnag