278 views

### Is there a way to create ZIP OutputStream ?

I want to write data to a file using compression. Is it possible to do that just in time (like in java ZipOutputStream). E.g. what I want: ...
686 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: ...
364 views

### How do I modify a symmetric matrix while maintaining symmetry?

I'm trying to figure out how to create a For loop for a symmetric matrix. I have a 5 $\times$ 5 symmetric matrix consisting of 1's and 0's and I'm trying to ...
211 views

### Converting a backward/forward sweep code for optimal control to _Mathematica_

I'm trying to convert to Mathematica a simple backward/forward sweep (with RK4 integrator) code to solve an optimal control problem in epidemiology, but I'm getting some error messages and I cannot ...
253 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 ...
2k 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 ...
712 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 ...
211 views

### For Loop to Sum numbers in a list

I'm asked to create a For[] loop that will sum positive numbers in a list. I am unsure of how to do this. ...
429 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: ...
461 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 "...
280 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: ...
286 views

### An efficient way to evaluate this expression with deeply nested Do loops

Is there an efficient way to evaluate something like this? ...
934 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 ...