Questions tagged [variable]

Questions on the use or manipulation of Mathematica variables (i.e. names associated with a changeable value). Use [variable-definitions] or [assignment] for questions on variable context localization, or assignment.

Filter by
Sorted by
Tagged with
-1
votes
1answer
112 views

Symbolic representation of Class Conditional Probablity as a variable

What is the best way to a create a symbolic variable to represent Class Conditional Probability in Mathematica e.g. $p(A|B)$
2
votes
0answers
98 views

Is there an easy way to to collect a large number variables into a list or list of lists? [closed]

I have a large number of variables in a notebook from a data analysis routine, the results of which now need to be fed through a mathematical model and various items for visualization. For example, ...
2
votes
2answers
773 views

How to set variable from imported data

I have an excel file i would like to import as data in mathematica with 3 columns like below: Column 1: the nodal numbers Column 2: the values of mx Column 3: the value of mxy Once ive imported the ...
3
votes
3answers
524 views

Getting a list of variable names as strings via a function

This is a new twist of an earlier question about how to get variable names as strings from a function. I would like to have a function that returns a list of variable names, each being a string, from ...
1
vote
1answer
95 views

Is it possible to “escape” numbers so they can be used as a variable name? [closed]

I would like to be able to use numbers in the names of some of my variables, it's simply easier to read that typing TwoPointZero. Is this possible? Or is there an alternative to being able to define ...
1
vote
2answers
244 views

Creating a List of Symbolized Indexed Variables

I am trying to creat a list of indexed variables (symbols) using the Notation package and Symbolize command. As an example, ...
0
votes
2answers
2k views

writing the expression for one variable in terms of another variable

I have a polynomial equation with 2 variables, lets say $x$ and $y$. For example: $x^2 + y^3 = 5$ And I want to write the above equation with $x$ on left side expressed in terms of $y$ on right side, ...
2
votes
1answer
92 views

Controlling the names of integration variables in DSolve

Consider the following command DSolve[{Derivative[2][y][x] == g[x]}, y[x], x, GeneratedParameters -> (Subscript[C, #] &)] With the following result ...
5
votes
2answers
337 views

Series expansion of a multivariable function to an order n for any number of variables [duplicate]

Suppose I want to expand a multivariable function to an order n. ...
0
votes
0answers
70 views

Using sub-scripted variables in functions

Is it possible to use subscripts in Mathematica functions, for example f[Subscript[x, a] _] := x^2 However this doesn't seem to work, is there a way to allow ...
1
vote
0answers
60 views

Assigning variables after solve [duplicate]

I have a set of 4 equations that I solved using the Solve function, resulting in the following output: I want to use these solution for further computations, so basically, I want to assign new ...
0
votes
1answer
69 views

List output as a variable within a forloop function changes

The above image shows my code. The graph plots my results for two different values of the variable "guards" (1000 and 200), having first produced lists of these figures. What I want is for mathematica ...
0
votes
0answers
84 views

Best practice for passing variables to many functions?

I am rewriting an application in Mathematica. The previous version used global variables, which I find distasteful, but to avoid it I am needing to pass several static Datasets and Associations around ...
6
votes
2answers
262 views

Want to return name of last defined variable without explicitly naming it

Suppose I have this code: dec = 7.1 + 6.6 + 27.2 + 66.5 jan = 7.1 + 6.6 + 27.2 + 66.5 + 65.7 feb = 7.1 + 6.6 + 27.2 + 66.5 + 65.7 + 69.7 And I want MMA to return:...
1
vote
1answer
120 views

Plot multiples of a variable

If I am plotting a square wave s.t.: ...
1
vote
1answer
38 views

Some challenge for a Table mixing between output number Variables and ToString symbols [duplicate]

How can I output a series of data, ranging from s00, s01, s02, s10, s11, s12, s20, s21, s22; by writing a table with s is a fixed, and m and n are running parameters, for example: ...
1
vote
1answer
114 views

solving of a polynomial equation with large coefficients

m trying to solve a polynomial equation with degree 4.. i have given the code below.. but it's taking too long and at the end shows a message that it has exceeded the time limit.. please help ...
0
votes
1answer
59 views

How to make the results form what i want

I have a question that method to make the result form what i want. equation =2 Integrate[-(L^3 h^2 (-2R1+L p0 h))/(2H),{h,0,1/2}] + (p0 L - 2 R1)/k (-2) The ...
0
votes
1answer
51 views

How to make result arrangement for the variable?

I was calculating equations, p2 := 1 e + r M1^2 p1 := 1 + r M2^2 p2/p1/.M2-> Sqrt[((r - 1)/(2 r))] Simplify@%/.e -> 0 where e : to remove by approximation ...
1
vote
0answers
27 views

Names of Variables in an Array [duplicate]

Foo={1,2,3}; Bar={4,5,6}; Blech={Foo,Bar}; Is there some way to retrieve the name variable name "Foo" from Blech[[1]]?
-1
votes
1answer
49 views

How can I get plot [closed]

here I want to plot the v vs p ...the code I used here... ...
4
votes
1answer
133 views

Map[Remove[#]] doesn't seem to do anything

If you have a symbol with a value, you can clear it with Remove[]. Thus ...
5
votes
3answers
331 views

One inequality with two variables

I would just like to know if this: ((a - b)/(b*Log[b])) - Log[Log[a]] + Log[Log[b]] exceeds 0 for any combination of a and <...
2
votes
1answer
107 views

Is there any way to enumerate “variables made special by use in arguments”?

I want to create a way to enumerate teal color coded variables in my Manipulate function. Specifically, I would like the user to input a number so that my function ...
2
votes
2answers
113 views

Returning Sin[t] from package turns into Sin[scope`t] [duplicate]

I have a function in scope that returns an expression with a variable t ...
0
votes
1answer
130 views

Define new symbols and “inverse” function

I have an expression that involve variables and conjugate of the variables eg ...
3
votes
1answer
124 views

How can we define lots of variables

I am new to Mathematica and some things I do not understand. Right now I need to write an algorithm which takes a polynomial in many variables, I denote it by $p_{i,j}$, and then I want to apply a ...
0
votes
1answer
70 views

Periodic function Iteration limit [closed]

I have two main issues. The first concerns Mathematica interpreting the same definition differently based on what I call the function, even though the name never occurs in any other part of the ...
1
vote
1answer
57 views

Variable calculation

So basically I have some code like this: Manipulate[ With[{ a = h + 5, b = a/2 }], {h, -10, 10}] It works fine for a but doesn't calculate the value of b. the ...
1
vote
2answers
76 views

Calculating a value

I'm trying to calculate the value of F12 and show the value of it on screen. But for some reason I keep getting Null as an output. ...
0
votes
1answer
105 views

FindFit for all columns of a matrix

I have a table of dimensions {10,3} say. Each column is the value of some function f(x,a) wrt to x and the parameter $a~ ( =1,2,3$ say) refers to the columns. So for example if we let $f(x,a) = a \...
2
votes
1answer
115 views

Transformation of variables in function in mathematica

How do i change variables of function in mathematica ? for example of f(p,q) = p^3 + q^3, from p,q to x= p-q and y = p+q, so that the function now becomes f(x,y) ?
0
votes
1answer
98 views

Why is N not valid as variable in ParametricPlot? [closed]

Why is ParametricPlot[{Log[N!], Log[Sqrt[2 Pi N] E^-N N^N]}, {N, 1, 10}] not working when ...
3
votes
2answers
115 views

Solve and naming variables

Let's say, I do this: ...
0
votes
1answer
102 views

Is there a way to apply Module and LocalizedVariables -> False simultaneously?

In my project, there are some variables that I want to define locally so that my defined function has no Manipulate dependency with each other when calling the function twice. By using ...
0
votes
0answers
104 views

How to provide input as a set and get a set as output too?

Friends here is the code given to a problem which i have been trying to solve lately but in the first equation i want value of 'k' to be [-1,1] or it should take every value from -1 to 1. And i know ...
6
votes
5answers
997 views

Checking if all the variables are present in the defined function

I want to check if a user input the function with all the specified variables or not. For that I choose the replace variables with some values and check for if the result is a number or not via a ...
1
vote
0answers
398 views

How to declare variables with plus/minus sign as subscript/superscript?

I am pretty new to mathematica, so please forgive me if I ask any stupid questions. I want to create a vector $a^{+}=[a^+_{k-2},a^+_{k-1},a^+_{k},a^+_{k+1},a^+_{k+2}]$ and then do some symbolic ...
1
vote
1answer
65 views

converting an operation on multiple arguments into an operation on a list [duplicate]

Let's say I have an operation like Intersection[{1, 2, 3}, {1, 2, 3}, {-1, -2, -9}, SameTest -> (Abs[#1] == Abs[#2] &)] but the arguments are being ...
0
votes
1answer
96 views

Variable name complication with DSolve? [closed]

I'm trying to run the code: ...
1
vote
2answers
716 views

Can you unpack a list of values into variables in a With expression?

For instance, if I am trying to draw a graph with 5 vertices labeled a through e, and I want to draw edges connecting a and b, a and c, a and d, a and e, b and c, b and d, and c and e, I would run the ...
3
votes
1answer
506 views

Protected Variable Error with Workbench 3.0

I have Wolfram Workbench 3.0, build 78, with Mathematica 10.4 as the front end. I am using Windows 10. I am trying to run a simple test source code test.m: ...
1
vote
1answer
121 views

How can I solve a set of equations with variables and eliminate a few variables at the same time?

I just started learning Mathematica since I needed for my current research. I'm trying to solve a set of equations with different variables, eliminate a few variables in the set, and express one ...
1
vote
2answers
234 views

Defining a variable with comma (or any other separator) in its name?

How can I define Mathematica variable/function with comma in it? For example, defineL00,1 as a variable? I plan to use L00,1 ...
1
vote
1answer
94 views

How to call a function with an arbitrary list as its arguments inside a functional? [duplicate]

I have the following functional defined (i.e. a function of another function) where variableList contains the variable (arguments if you wish) of the ...
2
votes
1answer
139 views

Substituting values of variables in solution of a system of linear equations

After solving a system of 21 linear equations in 21 variables (called Xi in my code) I got the values for all the 21 variables, in the following way: ...
5
votes
1answer
224 views

An alternative to subscripts?

Are there any good alternatives to using subscripts to keep track of and uniquely identify many variables? I know that subscripted variables behave badly. Thanks!
3
votes
1answer
108 views

Checking if input is a function

I would like to write a program to find the leading coefficient of a given polynomial. (Sounds easy, right?) I'd like to be able to handle the format x^2-x+7 (with ...
0
votes
1answer
43 views

Restricting the evaluation of variables [closed]

Hopefully you understand my question. I m calculating inverse kinematics of a robot and each subsequent value is dependant on the one before. For simple porting into c++ I would like something like ...
0
votes
1answer
74 views

Manipulate different function and variable

I have list of functions such that test = {test1[a,x], test2[a,x], test3[a,x]}; I would like to plot this three function using manipulation ...