The Stack Overflow podcast is back! Listen to an interview with our new CEO.

All Questions

13 questions
Filter by
Sorted by
Tagged with
6k views

Are there any cases when For[] loops are reasonable?

To my mind the only reason for the existence of For[] loops in Mathematica is to allow new users with some experience in procedural programming languages to write ...
217 views

How would one return from a place of a pure function's body using Return?

From previous answers, replies and discussions it is known, while not formally documented (even in the most recent Wolfram Language Documentation Center), that Return can be used in a two-argument ...
299 views

How to build these functions without nested For loops?

I am trying to solve the 8-puzzle using two heuristics, which are: Pieces out of place and Distance Manhattan. After consulting several websites for example see and some books, I'm with some doubts, ...
431 views

Iterating FindRoot to solve a differential equation

I am new to Mathematica style programming, better at traditional programming. I would like to know if I can create a table of results using FindRoot, where the ...
284 views

How can I solve the Ramanujan problem by using Wolfram language? [on hold]

The problem like this: find all integers n, 1 ≤ n ≤ 10, 000 such that n is the sum of two cubes of positive integers in two different ways. I want to solve the problem as a procedure in mathematica.
37 views

how to run a specific cell in a notebook from another notebook

I have a long Mathematica code in a notebook, denoted by NB1. Since it is a very long code, and I need only some of the outputs from NB1 to be used in another ...
243 views

Out of memory in a Do loop

I have the following code: ...
156 views

Add two functions in a table with the same variables

How can I print the values of the function expere in the table of the function exper ... Note that I use this code ...
83 views

Challenging antiderivative loop

I am attempting to create a loop (either Do, For or While) that will continue to take antiderivatives of f(x)= x until the area under it between 0 and 10 is greater than 1000. And whichever function ...
404 views