The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
83 views

How do I apply a rule to every element in a matrix? [closed]

I need to apply a set of rules (I used Which) to every element in a matrix, but the rules are dependent on the position [[i, j]] ...
2
votes
1answer
57 views

Applying rules to rewrite expressions that contain patterns

I'm trying to write a rule that can rewrite a pattern that exists in another expression. For some reason, this is proving to be more challenging than I expected ... most likely because I'm not totally ...
0
votes
0answers
53 views

Is there a faster way to do Normal[SparseArray[{{1,1,1}→1.2, {1,1,2}→20.2, …, {m,n,p}→0.3}]]?

I have a list of the form {{1,1,1}→1.2, {1,1,2}→20.2, ..., {m,n,p}→0.3} and I want to create an $m \times n \times p$ array, $A$, where the value of $A[[i,j,k]]$ is ...
1
vote
0answers
30 views

How to apply an rule to factors matching a certain form

Suppose we have many expressions involving irrational ArcTan expressions (such as ArcTan[Sqrt[3],5]) along with other irrational factors (such as ...
17
votes
1answer
485 views

What does ImageSize -> 1 -> 1 mean?

On the page http://www.wolfram.com/language/gallery/blur-faces-in-an-image/ the example code has ImageSize -> 1 -> 1. I am unfamiliar with this chaining of ...
0
votes
1answer
54 views
3
votes
1answer
45 views

Assign the Background rule in Grid (the positions can be described by a integer function)

For example, this code Grid[Transpose[Table[{n, n^2}, {n, 1, 10}]], Frame -> All, Background -> {{1 -> Red, 4 -> Red, 9 -> Red}}] produces , in ...
0
votes
0answers
23 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 ...
5
votes
2answers
154 views

How to “ReplaceAll” using a set of conditional expressions instead of a list of rules [closed]

Suppose that I have two linear functions f[x_] := f0 + f1 x g[x_] := g0 + g1 x and a (possibly rather complicated) set of conditional expressions, obtained ...
0
votes
3answers
108 views

How to find the Mean of results given as a list of Rules?

How can we find the mean of the following type of data? ...
0
votes
1answer
74 views

How to convert the expression '{a->a0, b->b0}' to the expression 'a=a0; b=b0'? [duplicate]

How to convert the expression '{a->a0, b->b0}' to the expression 'a=a0; b=b0'? I think this is a common question and do not know if someone has asked it before. Any help or suggestion will be ...
0
votes
2answers
74 views
11
votes
2answers
161 views

ReplaceRepeated seemingly omits some rules

Is there a simple way in Mathematica to prevent rule reordering? Let me give an example: ...
2
votes
2answers
80 views

Converting a date to a calendar quarter

I have a list that includes dates. I need to convert each date to be the last day of the quarter that it's in. So for example I want {2013,7,1,0,0,0} to become {2013,9,30,0,0,0}. Actually I don't ...
1
vote
1answer
64 views

using rules to look up values

I have a lookup table with about 30 rows. Column 1 has the value I want to search for and column 2 has the value I want returned. It seemed like I should be able to use rules to do this, but clearly ...
1
vote
2answers
105 views

ReplaceAll a list of rules to an equation

Given the following equation and rule, how would I Solve the equation for tr, k and ...
1
vote
1answer
73 views

Exporting data which includes rule as number only and use lhs as label

I use listD1 = Table[FindRoot[(*my eqns depending on k*), {k, conc}] to get a list of solutions for the different values of ...
0
votes
2answers
220 views

How to implement this simple product rule in mathematica [duplicate]

Firstly i have defined a simple function below. dotPro[a_, b_] := a[1]*b[1] + a[2]*b[2]; Then i create two terms using the above function. ...
1
vote
1answer
123 views

Simple rule appears not to work

I have the following simple code ...
4
votes
3answers
169 views

Renaming and indexing list of rules

I have a list of rules that represents a list of parameters to be applied to a circuit model (Wolfram SystemModeler model): ...
6
votes
2answers
224 views

How to replace a variable that was assigned a value before

Question How to make the replacement $f[x] \to f[y]$ for an abitrary function $f$ if $x$ was assigned a value before? Example 1 How can I make the replacement $x +1 \to y + 1$ if I have assigned ...