本文介绍了Mathematica 降值 Lhs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道 Mathematica 中是否有一个内置函数来获取降值规则的 lhs(没有任何持有)?我知道如何编写代码来做到这一点,但对于内置的来说它似乎足够基本

Does anybody know if there is a built-in function in Mathematica for getting the lhs of downvalue rules (without any holding)? I know how to write the code to do it, but it seems basic enough for a built-in

例如:

a[1]=2;
a[2]=3;

BuiltInIDoNotKnowOf[a] 返回 {1,2}

推荐答案

这似乎有效;不过不确定它有多大用处:

This seems to work; not sure how useful it is, though:

a[1] = 2
a[2] = 3
a[3] = 5
a[6] = 8
Part[DownValues[a], All, 1, 1, 1]

这篇关于Mathematica 降值 Lhs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 02:39