MATLAB: Calculate the number of square bracket in a text file.

regular expressionsstringtext file

Suppose I have a txt file. How can I find the number of square bracket (let's say [ ) in a txt file?

Best Answer

You could consider using find() or strfind() or sum() or nnz() or == or ismember() or length() or numels()