Tag Info

New answers tagged

1

For a visual, animated, description of basic behavior of such functions, I recommend: http://reference.wolfram.com/legacy/flash/ (You may want to turn on your computer's sound.)


9

These three functions are similar (speaking commonly), and in some applications any of them could be used, yet they have very different special applications. Rudimentarily: Map wraps (sub)expressions in a given Head, and returns the modified input Apply replaces Heads in (sub)expressions, and returns the modified input Scan "visits" (sub)expressions, ...


1

Specifying EdgeForm resolves the country borders. Latitude and longitude...well here is a clumsy way. Depending on your desired grid you may have to clean up conversion. myc[name_] := If[name == "UnitedStates", Red, Lighter[Gray]] lat = Quiet[ Line /@ Table[ Table[GeoGridPosition[GeoPosition[{j, k, 0}], "WinkelTripel"][[1, {1, 2}]], {j, ...


4

Padding additional brackets is not the right way to do it. You should use the right function for the task, which is Map: matrices = {{{3, 2}, {2, 3}}, {{3, 2}, {2, 3}}}; Eigenvalues /@ matrices If you're insistent on using Apply (why?), then the following ways work: Eigenvalues[{##}] & @@@ matrices Eigenvalues @@@ List /@ matrices


1

I got it: one has to put additional brackets around the first pure function: {({{foo[#1, #2], foo[#1, #1]}, {foo[#1, #1], foo[#1, #2]}})} & @@@ {{1, 2}, {1, 2}}


2

I was thinking about a more readable way because your question under rm's answer Any take on Q2 above? slightly indicates that you couldn't take it further although the idea to solve Q2 was similar. I guess my solution is in no way as easy as I had hoped it to be, but I give it anyway. What it does is that it separates the tasks a bit. The distributor ...


5

Here's a way to write out the map concisely: Q1: {1 - #, ##2} Through[Join[{1 &}, f]@#] & @@@ A (* {{1 - a1, b1 f1[a1], c1 f2[a1], d1 f3[a1], e1 f4[a1]}, {1 - a2, b2 f1[a2], c2 f2[a2], d2 f3[a2], e2 f4[a2]}, {1 - a3, b3 f1[a3], c3 f2[a3], d3 f3[a3], e3 f4[a3]}} *) Q2: Join[{1 - #[[1]]}, MapThread[#3 #@#2 &, {f, Most@#, Rest@#}]] ...



Top 50 recent answers are included