The tag has no wiki summary.

learn more… | top users | synonyms

7
votes
2answers
191 views

Display variable name instead of value

Is there a way to display the variable name instead of its value? for example, I need something likevarname = 1; function[varname]; and the output is ...
-2
votes
0answers
42 views

How can I resolve infinite error message from Solve command? [closed]

I am trying to get 4 types of solutions which are x1,x2,x3,x4 from 4 of each equations with iterations. Two variables need to be updated with the the total X value which is X=x1+x2+x3+x4 and these ...
1
vote
2answers
53 views

Pass the list of variables into function to change their values

I'm new to Mathematica, so I don't really know, how do what I want, and I don't even know how to google it. Doing one Mathematica task for my supervisor, I faced the following problem. I need to ...
0
votes
0answers
23 views

In lambda calculus, can the parameter of abstraction be a non-variable lambda expression? [migrated]

In short, my main confusion is between the two concept variable and lambda expression: I am reading this reference here: ...
1
vote
2answers
57 views

why the variable scope is not local when using evaluate to plot multicurve?

I noticed a surprising problem when using evaluate to plot multicurve, "evaluate" function actually consider global variable first, not the local! I can illustrate the problem using the following ...
1
vote
0answers
42 views

Settings to disable global scope

I am building a fairly large application in Mathematica, and globally scoped variables are causing issues. I would like globally scoped variables to be out-of-scope for my expressions, except by ...
0
votes
1answer
37 views

Why do For[] loop variables in different functions interfere?

I had something along the lines of: ...
0
votes
1answer
52 views

Assign values to variable names in lists

I hope somebody can help me in this (I guess) simple question: I have a list of variable names ls={w0,w1,w2} and another list of values ...
2
votes
2answers
60 views

Pattern evaluation in nested function call

I'll put the question right here, but will add some context below in case someone wonders why the heck I'm trying to do this. Why is it that I have to do two passes to get the value of the arguments ...
0
votes
2answers
195 views

How to pass a list as function argument?

I have the following function lFreqPhylo[a_, Q_, b_, p_] := Sum[Log[freqFunction[r[[p]][[i]], L[[p]][[i]], a, Q, b, {i, 1, nbranches[[p]]}]; The objects L, r ...
0
votes
1answer
25 views

How to output local variables when error message is generated without interrupting evaluation?

I am running a calculation to generate a dataset. I use several iterations to sweep over a parameter space. A few times an error message is generated (which is not the problem per se). Is it possible ...
2
votes
2answers
125 views

Using a variable for two different purposes

I want to name a bunch of tables after the OEIS entries which describe them. Is there any way to use these names for both the table name and the link at the same time? The second line uses the ...
2
votes
1answer
73 views

Strange behavior using variable in Exists

I came across a behavior that doesn't make sense to me when I tried to use Exists in Reduce. If I run commands: ...
4
votes
1answer
140 views

Variable number of nested variable-range sums

I would like to express the following nested sum in Mathematica: $$ S(m,j,N) = \sum_{k_1=m+j-1}^{N-1} f(N,k_1) \sum_{k_2=m+j-2}^{k_1-1} f(k_1,k_2) \cdots \sum_{k_m=j}^{k_{m-1}-1} f(k_{m-1},k_m) $$ ...
1
vote
2answers
128 views

Do multiple instances of Mathematica run completely independently?

Let me simplify the problem I am trying to solve so that the issue I face is highlighted. Say, I want to generate $n$ samples of a Gaussian random variable. I have a script (say ...
0
votes
1answer
85 views

Taking the time derivative of a function with more than one variable depending on t? [closed]

Yeah, I was wondering if it was possible ? I have a function which have different variables depending on time, like: $$\frac{d}{dt}mr^{2}\dot{\phi}$$ In this case both $r$, being a length, depends ...
4
votes
1answer
128 views

Why does one of my Manipulate integer variables get turned into a real?

I'm developing code for manipulating graphs. Spot the difference in the 2 Manipulates below: ...
1
vote
2answers
80 views

Using Array Elements as Function Arguments

Suppose I have an array p = {a,b,c,d} and a function f that takes a variable number of arguments. I want to evaluate ...
0
votes
0answers
32 views

Block, With, Module, can anyone help me understand the distinction? [duplicate]

I've been working heavily with Block[] for months in my research so I've read the documentation for the seemingly similar commands With[], Block[], and Module[]. Personally, I've had by far the ...
2
votes
2answers
98 views

Testing for arbitrary algebraic expression in given variable

I want to test, for example with MatchQ, if the argument of a function is an arbitrary expression in a single or several variables whose names can be assumed to be ...
0
votes
0answers
25 views

How to pass rules to packages [duplicate]

EDIT: After helpful comment from @Mr.Wizard I added the working implementation below for future reference. I wrote a module that does something with variables provided in form of a rule. It works ...
1
vote
1answer
56 views

storing rescaled images in new variables

I'm trying to assign random image files that undergo rescaling to a list of variable names. The images I'm trying to assign are the result of mapping the ImageResize function of two arguments to the ...
0
votes
0answers
136 views

Assign variable's value programmatically

Not easy to explain what I'm looking for, so please sorry if I'm not so short. Having many variables to be managed in several different combinations, I need to automate the assignment of preset ...