Replacement for CLEAR to avoid destructive behavior

バージョン 1.0.0.1 (1.65 KB) 作成者: Carl Witthoft
this clear.m ensures you'll never accidentally type "clear" or "clear all" and wipe your workspace.
ダウンロード: 11
更新 2019/4/29

ライセンスの表示

this function masks the builtin "clear" and carefully checks to make sure that "all" (or the default zero-argument case, which MathWorks foolishly made equivalent to "all") is not in the argument list. It accepts any mixture of string and cell arrays of string arguments.
Further, this function checks whether it was called from the console. If not , i.e. was called from within a function, it reverts to the builtin "clear" function so that function environments can be cleared as would normally happen.
With thanks to Cris Luengo and Andrew Janke over at StackOverflow.

引用

Carl Witthoft (2024). Replacement for CLEAR to avoid destructive behavior (https://www.mathworks.com/matlabcentral/fileexchange/71405-replacement-for-clear-to-avoid-destructive-behavior), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2015b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersWhos についてさらに検索
タグ タグを追加

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.1

cleaned up comments

1.0.0