Small mathematica operator question

In summary, the conversation is about shorthand notation in Mathematica and how to specify a specific variable in an expression. The shorthand notation is possible in Mathematica by using the "slash dot" operator "/." or the "Block" function. Both methods allow for specifying a specific variable in an expression.
  • #1
FocusedWolf
81
0
Hi,

Quick question. In the ti89 i can do this:

x+1|x=2
Answer = 3

It works like x + 1 given x = 2...do 2+1 = 3. I'm not sure what the '|' operator would be called in this case...

Anyway, is this shorthand possible in mathematica?

like if i had: yy = E^T*C[1]+C[2], and i wanted to specify C[1]=1/6... what would do it?
 
Last edited:
Physics news on Phys.org
  • #2
Code:
yy = E^T*C[1]+C[2] /. { C[1] -> 1/6 }
 x + y /. {x -> 2, y -> 1}
or just
Code:
yy = E^T*C[1]+C[2] /. C[1]->1/6
x+1 /. x -> 2
if you have only one replacement.

You can also do
Code:
Block[ {C[1]=1/6},
   E^T*C[1]+C[2]
 ];
if you need the expression more often, but since you assign it anyway that's not necessary here (thought I generally prefer not assign variables)
 
  • #3
Thx that'll do :cool:
 

1. What is a small mathematica operator?

A small mathematica operator is a function or symbol that performs a specific mathematical operation on one or more operands, such as addition, subtraction, multiplication, or division.

2. How do I use a small mathematica operator in my code?

To use a small mathematica operator in your code, you can simply type the symbol or function name followed by the operands you want to operate on. For example, to add two numbers, you can use the addition operator (+) and write "2+3" to get the result of 5.

3. Can I create my own small mathematica operator?

Yes, you can create your own small mathematica operator using the built-in functions in Mathematica. You can use the "Define" function to create a new operator and specify its behavior, such as the operands it takes and the operation it performs.

4. Are all small mathematica operators built-in functions?

No, not all small mathematica operators are built-in functions. Some operators may be created by other users or developers and shared through packages or libraries. You can also create your own custom operators as mentioned in the previous answer.

5. How do I find the list of available small mathematica operators?

You can find the list of available small mathematica operators in the Mathematica documentation. You can also use the "OperatorInformation" function to get information about specific operators, such as their syntax and usage.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
Back
Top