Linked Questions

523
votes
19answers
130k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
112
votes
3answers
6k views

What is a Mathematica packed array?

A simple sounding question with a few sub questions: What is the difference between unpacked vs packed array? Are packed arrays more space efficent, how much so? Are packed arrays more time ...
23
votes
7answers
2k views

Equating matrices (or higher order tensors) element-wise

Say I have two matrices (or, as in my case, higher order tensors) $A,B$, and I want to solve the equation $A=B$. To do so , I need a list of equations that equate entry-wise the elements of $A$ and $B$...
7
votes
4answers
660 views

How to delete Missing[“NotAvailable”] from list of rules? [duplicate]

Considering we have a list of rules: ...
7
votes
2answers
277 views

Built in function without Attributes Listable works as if it has Attributes Listable

Can Built-in function works as if it has Attributes Listable even if it doesn't have that ...
8
votes
2answers
1k views

Indeterminate expression 0^0 encountered

I'm new to Wolfram Mathematica so the the question may seem quite simple. I define the following function: ...
10
votes
2answers
191 views

GridBox/packed array behaviour

I have never used low-level formating functions, so this problem might have a simple solution. I'm currently pulling my hair out trying to solve it, however. Consider the following example: ...
4
votes
2answers
477 views

How can I use Max[] in a function that is passed a list not find the max of the list

For most functions in Mathematica, passing them a list will call the function on each element of the list. For example: ...
7
votes
2answers
207 views

Evaluation inside Inactivate

The documentation for Inactivate makes the function sound really powerful because it gives granular control over which kind of expressions specifically not to ...
9
votes
1answer
2k views

Extract common factor from vector or matrix

I can't believe this hasn't been asked before but I can't find anything. Is there a way to convince Simplify or FullSimplify to ...
7
votes
2answers
135 views

Cannot Block Plus

It is customary to use the following idiom to partially evaluate something inside a held expression: ...
5
votes
1answer
206 views

How to understand the difference between Sqrt and Log after ClearAll them

I came across this post, here I change the last line of the code Unprotect[Sqrt]; Sqrt[x_] = "blahblah"; Protect[Sqrt]; Sqrt[2] "blahblah" ...
5
votes
2answers
175 views

Strange Behavior when making Equal Listable in Pick

While trying to make this problem more efficient I tried different methods and dabbled with making Greater and Equal ...
8
votes
1answer
170 views

Strange behaviour of Internal`InheritedBlock

I was going to post an answer for fast way to replace all zeros in the matrix. I was even quite happy because timings were the same order of magnitude as others. The idea was to overwrite ...
18
votes
1answer
162 views

Help understanding overloading of Atomics within Block

Usually h @@@ {f[1, 2], f[3, 4]} === {h[1, 2], h[3, 4]} but this is not the case when f is ...