Linked Questions

10
votes
1answer
503 views

Why does NDSolve fail to solve the PDEs and spit out mconly warning?

I try to solve two coupled PDEs with NDSolve using the following code: Set two operators: ...
3
votes
1answer
1k views

Selecting elements from a list of lists [closed]

Being a novice, I'm having trouble with the following: I have a list of lists and want only those elements where the second element of the second level is positive. So, for example, from ...
3
votes
7answers
174 views

How can i change some numbers in a list?

I do not want to change all of them just some of them in particular rule. For example the list is given a={1,2,3,4,5,6,7,8,9....,100} If the number is bigger than ...
5
votes
1answer
404 views

Random walk in one dimension — meeting of two particles

I'm new to Mathematica and still teaching all by myself, hope you bear with me. I have the code: ...
2
votes
2answers
460 views

For/ Do loop on a lists of two variables

I am trying to get an output of the following kind Out = Do[Evaluate[f[x,y]],{x,table1},{y,table2}] Here Out is a N-times-1 dimensional array/list and N is the ...
4
votes
3answers
344 views

Dot products and For-loops

I'm taking a class where we're working with matrix applications inside of Mathematica. In this case, we're analyzing senatorial votes that have been numericized so that a value of 1 corresponds to "...
2
votes
2answers
251 views

How do I write this matrix?

The following code gives 20 data as output. How can I make a 5*4 matrix by that data list?
2
votes
3answers
131 views

Evaluating number of iteration with a certain map with While

Beeing used to programming in C-like languages I am struggling with iterations and loops with mathematica. I am trying not to use the For command, as already lots of people recommended. I am trying ...
0
votes
3answers
687 views

Find simultaneous roots of Sin[x] and Cos[x] using FindRoot, If, and For

I am a beginner of Mathematica, I happened to come across the following exercise which may seem trivial to the experts of this field but is hard for me to do at this level. I have the equation ...
3
votes
2answers
188 views

Correctly defining the return of a procedure

I am sort of new to mathematica and I am struggling with how to correctly set the return of a specific function which is a procedure. I am give the following task: Given the map $x_{n+1} = r x_n (1-...
3
votes
2answers
141 views

Print characters from list with a For-loop

Suppose I have the list primary = {"b","a","e"} I want to get the following output with a For-loop (or While-loop) "b" "a" "e" My code is: ...
1
vote
3answers
241 views

Extracting a 2 x 2 matrix from a 9 x 9 matrix [closed]

I have the following code: For[i = 1, i <= 9, i = i + 8, For[j = 1, j <= 9, j = j + 8, Print[k[[i, j]]] ] ] The code prints a column of the ...
0
votes
2answers
529 views

How to write if statement and for loop? [closed]

I am trying to write a function that will find a sum of all diagonal elements of matrix. I don't know how to do it correctly. This is how I tried do do it. ...
0
votes
1answer
459 views

ListPlot in a Loop [closed]

I have the following program which generates the plot from a data list(i.e. Data1). However I want to print some plots for some values of the parameter "a". How would I proceed to print the scatter ...
1
vote
2answers
93 views

What is wrong with the Mann iteration?

I have written the Mann iteration's code for the mapping $\frac{z}{1+z^2}$, in Mathematica, but it is very slow. In fact it needs more than 200 seconds for obtaining 17th iteration, while Matlab does ...

15 30 50 per page