How can I prevent Table[] from evaluating its arguments each time?

In summary, Mathematica is a software package used for mathematical and scientific computing, providing tools for data analysis, visualization, and technical documents. To create a table in Mathematica, use the Table command and customize its appearance with the TableForm command. Tables can also be exported to other formats and mathematical formulas and equations can be added using the Insert menu or TraditionalForm command.
  • #1
matiasmorant
39
0
I want to make a Table[] but aI don't want this function to evaluate its argument each time. for example, I want to make the table {12,22,32,42,...}, instead of {1,4,9,16,...}


how?
 
Physics news on Phys.org
  • #2
Two (out of many) possible approaches

In[1]:= Table[With[{nn=n},Defer[nn^2]],{n,1,10}]
Out[1]= {1^2,2^2,3^2,4^2,5^2,6^2,7^2,8^2,9^2,10^2}
In[2]:= Table[Superscript[n,2],{n,1,10}]
Out[2]= {1^2,2^2,3^2,4^2,5^2,6^2,7^2,8^2,9^2,10^2}

The advantage of the first one, is that if copied and pasted, it will evaluate as normal.
 
  • #3
Thanks a lot, I could do what I wanted
 

Related to How can I prevent Table[] from evaluating its arguments each time?

1. What is Mathematica?

Mathematica is a powerful software package used for mathematical and scientific computing. It provides a wide range of tools for data analysis, visualization, and creating technical documents.

2. How do I create a table in Mathematica?

To create a table in Mathematica, use the Table command followed by the list of elements you want to include in the table. For example, Table[i, {i, 1, 10}] would create a table with the numbers 1 to 10.

3. How can I customize the appearance of my table in Mathematica?

You can use the TableForm command to customize the appearance of your table in Mathematica. This allows you to specify options such as column spacing, alignment, and headings.

4. Can I export my Mathematica table to other formats?

Yes, you can export your table to various formats such as CSV, HTML, or Excel using the Export command. You can also copy and paste your table into other applications.

5. Is there a way to add mathematical formulas or equations in my table?

Yes, you can use the Insert > Typesetting menu in Mathematica to insert mathematical formulas and equations in your table. You can also use the TraditionalForm command to format your equations in a more traditional mathematical notation.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
936
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
17K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Classical Physics
Replies
14
Views
702
  • Calculus and Beyond Homework Help
Replies
2
Views
701
Replies
11
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top