最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wolfram mathematica - Cannot Clear K[r] with Clear["Global`*"] - Stack Overflow

programmeradmin4浏览0评论

Why doesn't the following simple code reset K[r]?

In[1]:=$Context K[r]=4r; Clear["Global`*"]; K[r] Out[1]=Global` Out[4]=4r

If I use, say, A[r] or B[r] instead of K[r], they get cleared. Just not K[r].

Why doesn't the following simple code reset K[r]?

In[1]:=$Context K[r]=4r; Clear["Global`*"]; K[r] Out[1]=Global` Out[4]=4r

If I use, say, A[r] or B[r] instead of K[r], they get cleared. Just not K[r].

Share Improve this question asked Jan 18 at 19:13 matrixbudmatrixbud 1335 bronze badges 1
  • Thank you, Bill. I figured there was something strange about K even though it isn't listed as a reserved symbol. You might write this up as an answer. – matrixbud Commented Jan 19 at 3:28
Add a comment  | 

1 Answer 1

Reset to default 2

It appears that there is something special about the symbol K

If you exit and restart Mathematica and then type

?K

followed by the Enter key then that returns

K is a default generic name for a summation index in a symbolic sum.

If you repeat exactly those steps with A or B that shows

Missing[UnknownSymbol, A]

Maybe that has something to do with what you are seeing, but I have not been able to find something in the documentation that exactly describes this.

This shows me again why I never name anything of mine beginning with a capital letter.

发布评论

评论列表(0)

  1. 暂无评论