It displays the unmatched brackets and the corresponding line numbers of the file.
If there is no unmatched brackets, it displays nothing.
Syntax : bracketmatch(fname)
The input fname should be a string of the file path and file name or just the file name if the file is in the same folder as the file bracketmatch.m
Please do not forget to include the quote symbol and file extension as input fname.
for example: bracketmatch('bracketmatch.m')
It displays: unmatched ')' at line: 12
Because the unmatched parenthesis is an ASCII char, and does not have a match.
The algorithm is from college level course Data Structure, chapter Stack.
引用格式
yi yang (2024). bracketmatch (https://www.mathworks.com/matlabcentral/fileexchange/116865-bracketmatch), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
创建方式
R2022a
兼容任何版本
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0 |