Linked Questions

0
votes
2answers
686 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. ...
4
votes
1answer
78 views

How to display a True/False table [closed]

Below is my written program ...
0
votes
1answer
272 views

Chi square minimisation wrt variables within an integration?

I'm trying to fit a model curve to some data by performing a chi square minimisation wrt three parameters $a,b$ and $NN$. The trouble I am having is that the variables with which I want to minimise ...
0
votes
1answer
45 views

An elementary question about For loop [duplicate]

Assume we have this For loop: For[i=1,i<10,i++, i^2]. How can we put the squared values ...
0
votes
0answers
21 views

How can I create a variable named from a concatenation of strings and assign it a value created similarly? [duplicate]

I have got a list of strings, a = {"first","second","third"}. For each of those strings I would like to create a variable called "The" followed by its content, so ...
0
votes
1answer
95 views

How can I get an array of numbers from the user and show the numbers with formatting?

Suppose that I have to print the following lines: Number 1 is 5 Number 2 is 6 Number 3 is 7 Number 4 is 8 Number 5 is 9 Now, if I were programming in C, I would have run the following code : ...
1
vote
1answer
251 views

Multiple file export

Here my code is running fine.In this code I put x=1 but I want to run x from 1 to 100 and for each value of x I want to export the excel file by the name according to x value.like for x=1 it export by ...
9
votes
2answers
657 views

Optimizing Mathematica Code

I have implemented the whole Baum-Welch Algorithm for training Hidden Markov Models as described in Rabiner's paper Here is my code that calculates the Forward Probabilities` ...
0
votes
1answer
104 views

FindInstance nonconstant parameter

I am trying to solve multiple instances of the same problem using FindInstance. ...
3
votes
7answers
198 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 ...
7
votes
8answers
536 views

Finding C[i]'s expression in DSolve solution

An example, the command DSolve[y''[x] - 4 y[x] == 1, y[x], x] gives solution ...
3
votes
0answers
72 views

Incrementally building a list without memory overhead

I have a task, where I have to combine pairs with a function, but the number of pairs I actually need is much smaller than the number of all pairs. The condition to keep the element is some function ...
3
votes
1answer
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 ...
0
votes
3answers
788 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 ...

15 30 50 per page