If I suppress an error, will the error still be suppress if I open the file on another computer?
1 回表示 (過去 30 日間)
古いコメントを表示
Nam Vinh Nguyen
2021 年 8 月 30 日
コメント済み: Walter Roberson
2021 年 8 月 30 日
If I suppress an error, will the error still be suppress if I open the file on another computer?
3 件のコメント
採用された回答
Walter Roberson
2021 年 8 月 30 日
If you ask to surpress for that one line, then a comment is added to the line with a %#ok pragma. That comment will stay attached to the line as it is part of the source code.
If you ask to surpress for that all lines in the file, then a comment is added to the line with a %#ok pragma, very similar to the previous case. That comment will stay attached to the line as it is part of the source code.
If you ask to surpress for all files, then your MATLAB preferences are modified, same as if you had set your Code Analyzer preferences. This change will be stored in the preferences information for that one version of MATLAB for that one user on that one system. If the user upgrades to one of the next two releases, then the upgrade procedure will copy that preference information for use with the new version, but it will not copy preferences for more than 2 years: the logic for that is that old preferences might not be compatible with the newer release. This kind of preference change is not copied with the file, and will not be copied to a different computer.
その他の回答 (1 件)
the cyclist
2021 年 8 月 30 日
Errors cannot be suppressed. If you mean supressing a warning, then I would expect that the best way to ensure the warning is suppressed on another computer is to put
warning('off',id) % Use the specific id of the warning you wish to suppress
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!