Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
関数には、ここclearvarsに示す指示があります。
clearvars
たとえば、一連の変数があるとします。
a, b, c, d
そして、 dを除いてこれらの変数をクリアしたいのですが、これを行うことができるはずです:
clearvars * -except d
しかし、次のエラーが表示されます。
clearvars * -except d | Error: Unexpected MATLAB expression.
これの理由は何ですか?
これは機能します:clearvars '*' -except d
clearvars '*' -except d
Matlab は、*それ自体の場合、文字列への変換に問題があるに違いありません。と の両方a*で問題あり*aませんが、 ではありません*。
*
a*
*a
また、これは機能します:
clearvars('*', '-except', 'd')
*キャラクターは必要ありません。