can be solved without 'regexp'
A slightly more robust test might include a balanced equation starting with something other than an opening bracket.
Test 3 might be
inStr = '3*(z*(a-(x+3))/(y))';
it doesn't work in some cases not included in test suite. for example:
inStr = '(z*(a-(x+3))/(y)*z)';
Seems to fail for inStr='(' , '((', etc.
I admit this is cheating, but I think it also stresses the need for more tests in the suite. Also, not all the cases should necessarily be visible, so you can't adapt a solution like this.
This solution fails for the input ')()', i.e. it returns true when it should return false.
This solution fails for the input '(()', i.e. it returns true when it should return false.
This entry is incorrect. It fails the simple case of:
Back to basics 4 - Search Path
Back to basics 18 - justification
Back to basics 26 - Keywords
Create an index-powered vector
Beginner's Problem - Squaring
Maximum running product for a string of numbers
Replace NaNs with the number that appears to its left in the row.
Return a list sorted by number of occurrences
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office