Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions on writing non-trivial programs in Mathematica. Do not use this tag for questions on plotting/graphics or for questions on doing mathematics with Mathematica, where the focus is more on the math than the program.
0
votes
1
answer
102
views
How to produce functions [closed]
I want to produce n functions. For example, assume that by giving n=3, 3 definite integrals will be created, like the following:
In[1]:= n=3;
(The algorithm and Processing )
Out[1]:={ Integrate[f1, …
1
vote
2
answers
332
views
Avoid making repeated Random Integer in different iterations
Assume following code :
Do[
i1 = RandomInteger[{1, 5}];
i2 = RandomInteger[{1, 5}];
While[i1 == i2, i2 = RandomInteger[{1, 5}]]
, {k, 1, 4}];`
This code makes two RandomIntegers which …
0
votes
1
answer
1k
views
A problem with functions and Infinite expression 1/0 encountering
Following code (function) makes integrals and then replace f[x] with Cos functions and calculate the definite parametric integrals as it is shown below :
DoGenerateIntegrals[Number_] :=
Block[{Gener …
4
votes
4
answers
220
views
How to get multiplication of the elements of a specific list/matrix
Assume there is a list:
List1={a,b,c,d};
Then I want to get these calculation:
Output1= a
Output2= a*b
Output3= a*b*c
Output4= a*b*c*d
Could you please help me with this problem? Thank you in ad …
0
votes
1
answer
251
views
How to save the results in an identical Excel file (.xls) in each iteration of a Do loop
Assume the following code (Below code is just an example to clearly illustrate my problem):
Res = {};
Iterations = 5;
Do[
Results = AppendTo[Res, i^2]
, {i, 1, Iterations}];
I have 2 questions:
…
-1
votes
4
answers
3k
views
Compare elements in a list
Assume that there are three different points in x-y coordinate like:
p1={4, -1};
p2={5, -2};
p3={1, 5};
In order to compare these points to each other in a specific criteria, I have first built Lis …
1
vote
2
answers
242
views
Ask about the variable and constants in partial derivative in a loop
EDITED
I have a function in a list like :
func={2(x^2)+x*y+3(y^2)};
I want to have a UI that ask me which parameter (x or y) is a variable in a Do[] loop, then calculate the partial derivatives of …
1
vote
4
answers
281
views
How to replace identical positions in two different lists
Assume that I have two lists like :
list1={1,2,3,4,5};
list2={a,b,c,d,e};
I want to replace some elements from list1 into list2 and make a new list, NewList. For example, I want to replace the eleme …
0
votes
1
answer
135
views
How to put some values from a list into a function in a Do loop
I want to program a code in MATHEMATICA in order to calculate some values in different iteration. For example, assume this list:
list={1,2,3,4,5}
Now assume that the function is :
f1=Function[u,3+u …
0
votes
1
answer
260
views
A problem with set values
The following code is just an example to clearly explain my problem.
Assume that :
In[1]:= Vars = Table[Symbol["x" <> ToString[i]], {i, 1, 4}];
In[2]:= Partition1 = Partition[Vars, 2];
Which the …
0
votes
1
answer
269
views
Setting up a system of equations for solution
There are two lists as follows:
Vars =
{{(x1)Cos[x2], Sin[x2], 0, (x3) (Sin[x2])}, {(Cos[x2]) (Sin[x4]),
(x3)Cos[x4], 1, x1}};
Const = {{1, 0, 0, 1}, {0, 1, 1, 2}};
Using Vars and Const, I …
1
vote
4
answers
484
views
How to update a list in a function in each iteration
There is a list with numbers 1 to 8 ( p1 ) and another list (j) which contains 4 numbers which shows different 4 positions of the elements in list p1. I want to take 4 elements from p1 related to the …