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 22099

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

2
votes
Using your definitions and looking at the output of an[10], we see that already here the output is very complicated, containing many nested parentheses. But an[n] is a polynomial of degree n in x so i …
answered Apr 3 '17 by Marius Ladegård Meyer
4
votes
This is one way: traffic[{lane_, lanes_}] := Block[{newlanes, free}, {free} = FirstPosition[lanes[[All, 1]], 0]; newlanes = Transpose[ Join[{ConstantArray[0, Length@lanes]}, Most[Transpos …
answered Jan 20 '17 by Marius Ladegård Meyer
0
votes
countOperations[expr_] := (Length@DeleteDuplicates@Cases[expr, #, Infinity]) & /@ {OpA[___], OpB[___]} should do the trick. Cases lists all occurences at any level (down to level Infinity in the ex …
answered Apr 8 '17 by Marius Ladegård Meyer
6
votes
I would use SubValues: define your functions with more than one []. This both makes it easier to write the plotting function, and it keeps the conceptually two different things, parameters and … built-ins, and to make autocompletion more useful :) Now both contourRe[f2[], {-2, 2}, {-3, 3}] and contourRe[f2[3,4], {-2, 2}, {-3, 3}] work. Functions without parameters also work, e.g. contourRe[Sin, {-2, 2}, {-3, 3}] …
answered Aug 10 '16 by Marius Ladegård Meyer
5
votes
Borrowing heavily from other answers here, but I wanted to do as much as I could inside Compile. On my machine, this is a bit faster than LLIAMnYP's main: runsComp = Compile[{{list, _Real, 1}}, Block …
answered Feb 7 '16 by Marius Ladegård Meyer
0
votes
Try these changes: automateStuff[j_] := Block[{out, l, t1, t2, LPairPo, m1, m2, xi, q, ELPrPo1}, out = Import["path/out"<>ToString[j]<>".csv"]; l = Replace[out, s_String :> If[StringMatchQ[s …
answered Aug 8 by Marius Ladegård Meyer
3
votes
Your current syntax is trying to Map the function {2} onto each element in the list generated transform2Time[#,10] &/@ {lst2,lst2,lst3} I think this is what you want? ulttst = N@Map[transform2Time …
answered Jul 10 '15 by Marius Ladegård Meyer
2
votes
The behavior you seek of remembering subcalculations is called memoization (Wolfram Tutorial) and could be implemented like this: delta = 10.; f2[x_]:= f2[x] = f2[x - delta] + NIntegrate[g[s],{s,x - …
answered Sep 23 '16 by Marius Ladegård Meyer