All Questions
Tagged with functions variable-definitions
76 questions
0
votes
1
answer
51
views
Defining Objects using a Table or Loop
Suppose I want to define weight[] on a list. For instance I want weight[a]:=3, weight[b]:=5, etc. I tried to do this using the ...
0
votes
1
answer
88
views
How to set optional variables in Function?
When using Function, is it possible to set specific arguments to be optional? For instance, in
f = Function[{x, y}, x + y];
Can ...
2
votes
1
answer
117
views
How to directly define a function as the solution of RSolve
This is probably very simple, but I just cannot find this anywhere online. I have the code
...
1
vote
1
answer
104
views
Function definition inside Module with local symbol
Usually if I want to define a function using an expression I do:
expr=x^2;
f[x_]=expr;
which usually works and give f a defination.
But now if I want to do the ...
2
votes
5
answers
294
views
Repeating definitons of variables
I have the piece of definitions
y = 1;
x = 2;
n = 2;
a := (y^(x - 1) + n)/(y^(x - 1) + y^(x - 2))
I want to keep defining y as a by doing:
...
2
votes
1
answer
95
views
Defining function for decimal value k[0.5+0.5]
k[1 + 1] = 2;
k[1 + 0.5] = 1.5;
k[0.5 + 0.5] = 1;
{k[2], k[1.5], k[1]} // TableForm
2
1.5
k[1]
Can you explain this phenomenon? I think the output should be
...
1
vote
1
answer
88
views
Initializing a system of abstract functions with a for loop [closed]
I am trying to initialize a collection of abstract functions $\theta_k(t)$ in a variable $t$ where $1\leq k\leq n$.
I cannot define them explicitely; the entire point is that I want to numerically ...
2
votes
1
answer
318
views
Can you use superscripts as variable and function names?
I want to express the following function:
$z^{(1)}=w^{(1)}a^{(0)}+b^{(1)}$
I have read in Mathematica documentation that Symbolize can be used to define variables ...
8
votes
1
answer
127
views
6
votes
1
answer
649
views
Is K is a function? [duplicate]
Some of the capitalized single letters are functions. Starting a fresh kernel and typing in the 24 capital letters, the following letters turn black since they are special functions,
...
0
votes
1
answer
106
views
How to define prefix that can turn numeric?
I put these prefix in my init.m file. First I Unprotect all these symbols, set values and then
...
0
votes
1
answer
322
views
How to convert mathematica root expression to readable one? [duplicate]
I am trying to find out at what regions a function is monotonically decreasing. The function is a function of X and has two more variables epsilon and B with the constrains 0 < B, 0 <epsilon< ...
2
votes
2
answers
112
views
Problems with TagSet
I am new with TagSet and TagSetDelayed and I'm not understanding properly how they works. I introduced the following definition:
...
1
vote
0
answers
47
views
Defining a function expression [duplicate]
I'm sure this has been answered before, but imagine I have the following function
...
3
votes
0
answers
64
views
Definition of large expression - makes PC freezed
In[1] A=Range[10^4];?A
Out[1] (* definition of A*)
It works for 10^4. But if I increase the number to 10^6
...