Mathematica:如何防止对 In[-1] 进行评估? [英] Mathematica: How to prevent evaluation of In[-1]?

查看:28
本文介绍了Mathematica:如何防止对 In[-1] 进行评估?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 In[-1] 在 Wolfram Mathematica 5.2 中获取最后一个输入表达式时,我得到了评估输出:

When I'm trying to get last input expression in Wolfram Mathematica 5.2 using In[-1] I get evaluated output:

In[1]:= On[In]
2 + 2
In[-1]

Out[2]= 4

During evaluation of In[1]:= In::trace: In[-1] --> In[$Line-1]. >>

During evaluation of In[1]:= In::trace: In[$Line-1] --> In[2]. >>

During evaluation of In[1]:= In::trace: In[2] --> 2+2. >>

Out[3]= 4

如何获得未计算形式的输入表达式?

How can I get the input expression in unevaluated form?

推荐答案

你可以试试 InString[]

In[1]:= 2 + 2
Out[1]= 4

In[2]:= InString[-1]
Out[2]= "\\(2 + 2\\)"

这篇关于Mathematica:如何防止对 In[-1] 进行评估?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆