Tagged Questions

Questions about the use of built-in Mathematica functions, including pure functions.

180 views

Why is this evaluation halved when adding units?

Why does this strange behavior occur when dealing with units and quantities? ...
59 views

How to put Black as the background colour, and text as white in Mathematica? [duplicate]

My question is equal to this one,even though by different reasons. I would like to know how can I change the white background to black, and the black text to white. I'm asking again, since a year has ...
96 views

Parametric Function

i'm struggling to implement the following parametric function: I need to create a g function with two arguments (w and v). If w and v are not empty lists, then it will return a list containing two ...
58 views

Input Reduce[Mod[a + x, l] == 0, x]' and output x == -a + kl`?

Reduce[a + x == k l && k > 0, x] (* k > 0 && x == -a + k l *) I think a + x == k l and ...
137 views

How to use Manipulate to cycle through a list of lists over a function

So I can do something like this which I like: Manipulate[i, {i, {1,2,3,4}}] It lets me pick which specific values I want to allow to be chosen for my function. ...
94 views

How to add my own functions to the library? [duplicate]

I would like to have my own functions (some sort of helper or utility functions) available all the times I run Mathematica. How to do that?
84 views

Solving coefficients of a function having boundary conditions

I have a function F=c+dz, which has particular boundary values, say F(z=1)=2 and F(z=-1)=1, ...
130 views

FullForm applied to functions

I would have expected FullForm[Cases[{a^2, a^3}, a_^1]] to produce Cases[List[Power[a, 2], Power[a ,3]], Pattern[a, Blank[]]]...
149 views

174 views

Josephus problem

See the Josephus Problem. My code takes in two numbers; one is the number of participants, and the other is supposed to be the number of players skipped between executions. ...
71 views

Incomplete Integration in Area

Area[2 Sqrt[(1 - p^2)^2 - r^2], {p, 0, 1}, {r, 0, 1 - p^2}] is able to perform only the integral over r, leaving the integral ...
120 views

How to fill a Marshal buffer with whitespace using NETLink

Further to Todd Gayley's answer on string handling in a DLL function, I have the following code: ...
81 views

Aborting from a Dialog box

I'm trying to abort a While cycle, with a dialog box. I've tried the following: ...
328 views

Default behaviour of Hash[expr] and hashing in different versions of Mathematica

In different versions of Mathematica, Wolfram silently changed the behaviour of Hash when the algorithm is not specified explicitly ...
166 views

Function that returns the second argument of Reap

I'm trying to create a function that returns only the second argument of Reap. Here's my naive guess of how it would go : Reap2[x_]:= Flatten[Reap[x][[2]],1] ...
425 views

More Ticks::ticks errors in AbsoluteOptions in v10

Bug introduced in 7.0 or earlier and persisting through 10.4 or later While the specific bug affecting Plot described in AbsoluteOptions prints error messages in ...
183 views

choose any number e that is relatively prime to n

I try to write a command that means choose any number e that is relatively prime to n, like e^n [Congruent] 1 (mod n), but it didn't give me a value of e. e^n [Congruent] 1 (mod n)
46 views

Regarding Cycles and Lists of Functions

So, I'm trying to determine the Normal Matrix of a Least Squares Aproximation; I have a basis constituted by 8 functions f1,f2...f8; I have 9 points which constitute Datax = {x1,x2...x9} Now, I ...
388 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[1]][[2,1]] results in <...
69 views

Binding trigonometric terms

I have many terms like A = Cos[Pi/18 + 2 x] + Cos[Pi/18 - 2 x] and I want to convert A to ...
105 views

Defining a function using a preceding expression

How can I automatically define a function inside my Mathematica code using a result (expression) that preceded the point of definition. For example: ...
184 views

Quantize a real-valued function?

I'm wondering if there's a built-in way in Mathematica to take a function whose output values are continuous, and quantize it to produce a step function. For example, I have the function ...
90 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 ...
335 views

Where is the old option TraceInternal->True?

Already at least in version 2 (I think), the function Solve calls the function Roots. At that time, I had a rather dirty trick, that still works, to verify this: ...
112 views

Define function over expression

Suppose I have the following expression system = x + y + z And I would like to define a function that contains this function, without explicitly typing the right ...
308 views

Difference between Evaluation>>Quit Kernel and Quit[]

What is the difference between Evaluation >> QuitKernel and Quit[]? Both seem to quit the kernel (and clearing all ...
69 views

Lists for built-in functions that can work without brackets

I just noticed that Exit and Quit can work without brackets i.e. a single Exit or ...
103 views

FinancialData Input

What does the function FinancialData require as input for natural gas: http://finance.yahoo.com/q?s=NGG15.NYM Is it easier to export the natural gas data to excel,...
901 views

Generating Random Real numbers with certain numbers not included

I'm writing a program that i need 1000 real number between -3 and 6. the code that I used for generating and saving them was l = RandomReal[{-3, 6}, 1000] But I ...
121 views

RegionPlot fails when given function with internally redefined variables

I've just upgraded to v10, and have noticed that some of my trusty old notebooks which used RegionPlot now fail to run. I've boiled down the problem I'm having to ...
70 views

Improving RationalInterpolation Result

The following code produces a {4,4} rational interpolation approximation accurate to 10^-6 or better over the range ...
237 views

Composition of Multivariable function

I am trying to compose functions of xleft, maybe like xleft[xleft[f]] or even higher order. And here is my function: ...
78 views

Diffentiating a function f with respect to x [duplicate]

I have a tabe y={10,20,30,40...} and x={62,63,64,65...} y is a function f and this function needs to be interpolated. How do I defferentiate the function f with respect to x?