All Questions

Tagged with
90 questions
Filter by
Sorted by
Tagged with
121 views

Is there any command similar to Delaunay of matlab?

After finding this webpage where they mention the generation of land using matlab, In its section how it works, explain its operation in detail, I started trying to do it in MMA but I am doubtful of ...
302 views

Improving Performance of an XY Monte Carlo

I normally write my Monte Carlo codes in Fortran for speed, but I was doing some quick and dirty work and wrote one in Mathematica for the XY model on a square lattice (see Kosterlitz-Thouless ...
87 views

Function with string explanation for its arguments with equal signs [duplicate]

I want to write a function using string as explanation for its arguments so that the function becomes intuitive for new users. For example, I want to write a function to compute BMI (just for ...
143 views

Pure functions applied to a two dimensional list

Lets say I have a two dimensional list: list = {{a, b, c}, {aa, bb, cc}, {x, y, z}, {xx, yy, zz}}; and two pure functions: ...
51 views

Define a function with specific permutation properties

I want to define a function evaluate[f_[x__]] which acts on an arbitrary function f[a,b,c,d]. The function ...
109 views

Complex partial fraction expansion

I would like to have a tool for partial fraction expansion of polynomial quotient $$\frac{P(z)}{Q(z)},$$ where the order of the polynomial $P(z)$ is less than that of $Q(z)$. The output of the ...
75 views

Calling a notebook from a different notebook

Basically I have a notebook (let's call it nb1) that when evaluated yields one number when I specify some parameter $\alpha$ (in nb1). I want to call nb1 in a different notebook (nb2) using for ...
1k views

Sisyphus Random Walk

A Sisyphus Random Walk evolves as follows: With probability (r) you advance the position of the walker by +1. With probability (1-r) the walker resets at x0 = 0. To simulate the probability of reset ...
100 views

How to use external Mathematica Code? [duplicate]

I have a Mathematica Notebook with a function that i would like to be able to access from another Notebook without having to have the first Notebook open. The functions calls other functions in the ...
48 views

An Alternative Solution to a List Manipulation Example

Is there any way to write a code that has a function include Block[ ] and Do[ ] loop instead of my code? Here is my code: ...
77 views

Recall the names of functions used in a long MMA code

Suppose you have a very long code in which many new functions are created. For efficient programming, very short and easily iterated function names are preferred. ...
171 views

Integration of a function that oscillates rapidly (apparently)

I would like to know if you could help me solve some doubts about the integration of a function that oscillates rapidly (apparently) that depends on time and two angular variables. The parameters S ...
95 views

Help! SystemException[“MemoryAllocationFailure”]

I am trying to run this code: ...
123 views

how can i convert my matlab conde into mathematica or atleast convert the bisection program? [duplicate]

(Convert matlab code into mathematica code) (I'm fairly new to mathematica) (bisect function matlab code:) ...
720 views

Recursion - Concentric Circles

I'm trying to develop my Wolfram programming skills and set myself an exercise of creating concentric circles using a recursive delayed function: ...
697 views

Unexpected behaviors in built-in functions

Existence of this topic is discussed in this mathematica.meta post. I'm sure I am not the only non-beginner in WL who from time to time finds themselves not being able to predict an outcome of a ...
1k views

Generate white noise in 2D

I am trying to generate a random (white noise) signal, as mentioned in the section Frequency Synthesis of Landscapes (and clouds) on this website. The problem I have is that I do not know if ...
44 views

Looping variables not replaced by their values

Sometimes Table[ ] leaves the looping variable in the output, instead of replacing it by the values. For example ...
354 views

How to convert from C to Mathematica?

I am trying to understand what is explained in this webpage, in the section entitled "Generating noise with different power spectra laws". After reading that section, I thought I could do it in ...
77 views

Write Partition of $n$ as an $n$-tuple

I recently asked the question (Computationally Employ Sum over Ordered Partitions?) which I think I can work through. But there's a subtelty I overlooked before that problem is even well-defined, ...
68 views

Computationally Employ Sum over Ordered Partitions?

I have the following function defined, with two inputs $g$ and $h$: ...
48 views

Is there an equivalent to defstruct in Lisp for Mathematica? [duplicate]

I guess I am used to using data structures in most languages, the closest function for Mathematica would be similar to the defstruct macro in Lisp... is there such a thing?
81 views

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 ...
173 views

How can you get the area of a region from an image?

Suppose we have a square of side "L" m, How can I calculate the hatched area, if the corners of the square are centers of circles. It can be generalized to any region? edit: This is the result I ...
1k views

Creating a Cayley's table of square

I'm interested in creating a Cayley's table of square using Mathematica. I'm not a programmer but occasionally resort to using Mathematica to simplify my work insofar as the programming doesn't take ...
917 views

How to properly use conditionals inside NDSolve

Currently I am working with Mathematica to learn the program, and I'm confused what exactly is wrong with this code. ...
232 views

How do I create an array by applying a function to the index of each element?

I am looking for something like matrix(m, n, f), but for Mathematica rather than MuPAD, and for arrays rather than matrices. That is, I'm looking for a(n efficient)...
1k views

FindShortestTour to solve Traveling Salesman Problem

I'm trying to write my own code to find the shortest route but I'm lost on how or where to start. Does anyone have any idea how the FindShortestTour function works? What type of algorithm or structure ...
376 views

Expressions containing globally undefined symbols inside a function where they are defined

Consider the following code. f[a_,b_]:=x x=a+b; f[1,2] (* a + b *) From a certain viewpoint, one might expect it to return 3 ...
2k views

Divide all but the maximal element in a list by 10?

I have a list of numerical data, and I want to write a program that will keep the maximum as it is, but reduce the rest by certain factor (such as 10). For example: ...
572 views

What is shorthand way of Reap list that may be empty because of zero Sow

Sometimes because of conditionals, you cannot guarantee that Sow will be called at least once. Reap[Sow][[2,1]] results in <...
144 views

How to package a function for export?

I often post code for functions on Stack-Exchange, and then later find that they are unexecutable - that people can't use them because I mistakenly omitted some private functions or values that are ...