Linked Questions

4
votes
3answers
361 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 "...
12
votes
1answer
523 views

Pascal records and Mathematica programming

Background: "experienced" Pascal-programmer (DOS-era, never got into OOP) proud owner of Mathematica ver 11.2 have used Mathematica for years to do my share of number crunching and plotting to ...
2
votes
3answers
134 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 ...
3
votes
2answers
190 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-...
5
votes
3answers
1k views

How to speed up a process

I am wondering how to speed up the following code: Currently it takes more than two sec to be processed. ...
3
votes
2answers
889 views

For Loop and Sum

I am requested to do a sum of the first fifty positive even numbers by using For loop. The For loop that I created is ...
5
votes
7answers
335 views

Computing only Prime Powers with NestList

Is there a simple way to compute only prime powers of a function f with NestList? That is, I want to compute: {f[x_0], f^2[x_0]=f[f[x_0]], f^3[x_0], f^5[x_0]...} ...
0
votes
0answers
60 views

For loop to define a Matrix

Suppose I have a matrix, Mat = MatrixForm[{{1.5, 2.83034}, {1.50476, 2.82655}}] I need to define parameters such that in the matrix 'i'th component is 'Lambda' ...
1
vote
2answers
118 views

How can I combine the output of a `For` loop into a list?

I am currently writing on a code to get RandomNumbers which are geometrical distributed. But i need the output in one list because i want to plot the output Can anyone help me? Here is the current ...
0
votes
1answer
435 views

Solve a system by Cramer's rule using loop

Consider the linear system AX=B,where A={{3, 0, 2}, {-3, 2, 2}, {2, -3, 3}},B={{3}, {-1}, {4}} and x=...
1
vote
1answer
88 views

Is there any way to save time using of “Cross” or “Table”?

I need to solve a equation by NDSlove, so I write the equation first, but it takes me a lot of time. The follow is my code ...
5
votes
1answer
470 views

An efficient way to translate a triple for-loop from Matlab to Mathematica

This is my first post on StackExchange, so if I violate any etiquettes, I apologize in advance. I am a senior engineering student who has been using Mathematica for a year now. For one of my classes, ...
0
votes
2answers
48 views

Expressing values from an evaluated If function as a list

For[i = 0, i < 4, i++, Print[i]] gives the result: 0 1 2 3 by the definition of the If[] function. Given a much longer ...
2
votes
2answers
253 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?
1
vote
2answers
74 views

How can I construct a matrix by programming in mathematica?

I want to write a matrix in Mathematica by programming. How can I write it? The matrix is : $ M= \begin{bmatrix} 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & ...

15 30 50 per page