如何使用带下标的变量?

How can I use variables with subscripts?

来自Mathics,我试过:

Subscript[a, 0] = 1

但它给出了错误:

下标 [a, 0] 中的标记下标受保护。

此消息表示您尝试执行的操作没有意义。下标是一个系统函数,可以防止被无意中重新定义,与加号 (+) 或任何其他内置系统函数完全一样。

根据:

https://reference.wolfram.com/language/ref/Subscript.html

Subscript is an object that formats as x_(y).

您收到与您尝试过的相同的错误消息:

 Plus[a, 0] = 1

另请注意,Wolfram 语言和数学中的列表从 1 而不是 0 开始。

以下是如何创建列表变量 a,其元素在索引 1 处包含值 1:

$ mathics

Mathics 2.0.1.dev
on CPython 3.8.8 (default, Feb 27 2021, 09:08:32) 
using SymPy 1.7.1, mpmath 1.2.1, numpy 1.20.1, cython 0.29.22

Copyright (C) 2011-2021 The Mathics Team.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
See the documentation for the full license.

Quit by evaluating Quit[] or by pressing CONTROL-D.

In[1]:= a = {1}
Out[1]= {1}

In[2]:= a[[1]]
Out[2]= 1

也许 https://www.wolfram.com/language/fast-introduction-for-programmers/en/lists/ and https://www.wolfram.com/language/fast-introduction-for-programmers/en/assignments/ 是个不错的起点。