Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 12

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

6
votes
To decide whether the behaviour is resonable, let us think about a straightforward way to implement this function. I would do this: Clear[subdivide] subdivide[xmin_, xmax_, n_] := Table[xmin + (xmax …
answered Nov 23 '17 by Szabolcs
3
votes
One way: myTicks[min_, max_] := Table[ Module[{q, r}, {q, r} = QuotientRemainder[x, 60]; q = Mod[q, 24]; q = IntegerString[q, 10, 2]; r = IntegerString[r, 10, 2]; StringJoin[q, ":", …
answered Feb 21 by Szabolcs
1
vote
Write these definitions in a file with the extension .m or .wl. You can create such a file with the menu item New -> Package/Script -> Wolfram Language Package. Then you can load that file (i.e. eval …
answered Jun 1 by Szabolcs
8
votes
These are different ways to write the same: (f[#] // Print) & Print@f[#] & Print[f[#]] & f[#] // Print & is parsed as (f[#]) // (Print &)—mind the precendence. The following are also effectively …
answered Feb 9 by Szabolcs
11
votes
Trying to guess at what may be confusing to a beginner about Mathematica, the following may be helpful: In many other languages if you call a function it either stops with an error or returns with a …
answered Aug 23 '16 by Szabolcs
3
votes
All functions ending in Q will always return either True or False. PrimeQ[x] evaluates to False if x is not an explicit prime number (i.e. if x is a symbol or something else). Thus your PrimeQ[f[x …
answered Dec 7 '16 by Szabolcs
9
votes
Use 2 UnitStep[x] - 1 where x can be a number or any array of numbers. If you never need to handle 0, use Sign.
answered Oct 21 '16 by Szabolcs
3
votes
Use Intersection for good performance. Union[{2,5}] === Intersection[{2,5},{1,2,3,4,5}]
answered Jun 2 '14 by Szabolcs
1
vote
In version 10, RegionBounds@ImplicitRegion[x^2 + y^2 + z^2 == 1, {x, y, z}] (* ==> {{-1, 1}, {-1, 1}, {-1, 1}} *) FunctionRange[{y, x^2 + y^2 < 1}, x, y] (* ==> -1 < y < 1 *)
answered Jun 28 '14 by Szabolcs
18
votes
same reason: avoid conflict with notebook code that doesn't have its own namespace.) The documentation has some information about which functions have changed and how. The version when the … PlotTheme -> "Classic" in plotting functions, or using the global setting $PlotTheme = "Classic" I do not know if this setting reverts all styles fully or not. Updates: PlotTheme -> None may be a …
answered Jul 11 '14 by Szabolcs
2
votes
You can use systemFunction[x_, y_, z_] = system Note the use of = instead of := and see What is the difference between Set and SetDelayed?
answered Dec 3 '14 by Szabolcs
4
votes
In these situations we use pattern matching instead of conditionals in Mathematica. You just need to make two definitions: f[x_?NumericQ, y_?NumericQ, s_] := ... f[x_, y_, z_] := ... The first, m …
answered Mar 5 '14 by Szabolcs
9
votes
The reason why Solve fails here is that it does not understand that Subscript[y,1] and y are independent and unrelated. You can avoid this problem by making sure that you won't use the symbol from in …
answered Feb 25 '13 by Szabolcs
12
votes
When I told you that this was not possible, I was wrong. My understanding is that you have points $(x_1, y_1), (x_2, y_2), ..., (x_n, y_n)$ through which you construct an interpolating function $f$. …
answered Jan 28 '12 by Szabolcs
18
votes
If you have a domain, you can often find a range using Interval. Examples: In[1]:= Sin@Interval[{0, 2 Pi}] Out[1]= Interval[{-1, 1}] In[2]:= Sin@Interval[{0, Pi}] Out[2]= Interval[{0, 1}]
answered Jul 7 '12 by Szabolcs

15 30 50 per page