I'm having the cell array res with cells 3x2, each of them containing a string. I want to apply regexp to each cell and it should look like that:
fin = cellfun(@regexp(res, '\.', 'split'),res,'UniformOutput',false)
however it doesn't do the job. Anyone knows how it can be combined properly?
Perform Case-Insensitive Matches By default, regexp performs case-sensitive matching. The regular expression specifies that the character vector: Begins with any number of alphanumeric or underscore characters, \w* . Ends with the literal text case .
To refer to elements of a cell array, use array indexing. You can index into a cell array using smooth parentheses, () , and into the contents of cells using curly braces, {} .
You were on the right track, but the syntax of your anonymous function is wrong. Try this:
fin = cellfun(@(x)regexp(x, '\.', 'split'), res, 'UniformOutput', false)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With