Linked Questions

3 votes
1 answer
127 views

Can evaluation show what was evaluated along with results? [duplicate]

After I write and evauate the following lines in Mathematica: a = 1 b = 2 x = a + b It will show only the result : 3. I want mathematica to show the following ...
Adi's user avatar
  • 31
0 votes
0 answers
230 views

How to evaluate only arguments, but leave topmost expression unevaluated? [duplicate]

I want to represent expressions mostly in unevaluated form, but being able to evaluate it's subparts. For example, how to evaluate only arguments, but leave topmost expression unevaluated? For ...
Suzan Cioc's user avatar
  • 2,023
0 votes
3 answers
159 views

Partial evaluation of a function [duplicate]

In the spirit of a previous question, this is a self-assigned exercise in order to understand how we can control expression evaluation with Mathematica. So, given the following function definition: <...
Sylvain Leroux's user avatar
597 votes
19 answers
154k 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 ...
44 votes
8 answers
9k views

How to apply or map a list of functions to a list of data?

Say I have a group of functions: f1[a_] := a * -1; f2[a_] := a * 100; f3[a_] := a / 10.0; and some data in a list: ...
cormullion's user avatar
  • 24.2k
104 votes
2 answers
7k views

Is it possible to define a new PlotTheme?

In version 10 one can define, say, $PlotTheme = "Scientific" Which changes the appearance of all plots. This is fantastic because on the one hand I can have nice ...
Yi Wang's user avatar
  • 7,317
22 votes
9 answers
3k views

How do you check if there are any equal arguments(even sublist) in a list?

I would like to set up a function which has to return True if at least two arguments of a given List are equal. So if I give {1,4,6,2} to the function it has to ...
Gianpiero Cea's user avatar
43 votes
4 answers
3k views

Compiling more functions that don't call MainEvaluate

I would like to use Compile with functions defined outside Compile. For example if I have the two basic functions ...
faysou's user avatar
  • 11k
54 votes
2 answers
10k views

How to access new colour schemes in version 10?

Many colour schemes and colour functions can be accessed using ColorData. Version 10 introduced new default colour schemes, and a new customization option using <...
Szabolcs's user avatar
  • 233k
13 votes
6 answers
1k views

Elegantly split a matrix into positive and negative parts?

I have a matrix $M$ of real components, and I want to split it into two matrices $M^+$ and $M^-$ of the same dimensions as $M$, where $M^+$ contains the positive components of $M$ (the remaining ...
a06e's user avatar
  • 11.1k
37 votes
3 answers
994 views

Can we intelligently control evaluation in Thread?

This is a bid at creating a canonical Q&A. Many questions have been asked that come down to the fact that Thread evaluates its first argument before threading ...
Mr.Wizard's user avatar
  • 270k
19 votes
6 answers
2k views

How can I evaluate only a single step of a recursive function?

Let's say have a simple recursive function for the Fibonacci sequence f[0] := 1 f[1] := 1 f[n_] := f[n - 1] + f[n - 2] but I want to see how it will expand in a ...
Jakub Arnold's user avatar
14 votes
7 answers
904 views

How to properly inject iterators into table? [duplicate]

Goofing off on a prior question, I was fiddling with other methods, which led me to the need to inject a constructed set of iterators into a table construct. Now, ...
ciao's user avatar
  • 25.6k
36 votes
2 answers
2k views

Specifying non-conflicting PlotTheme options

A bug or limitation in 10.0.0 affects a few of these examples; it was resolved in 10.1.0. I am trying out Mathematica 10 on https://programming.wolframcloud.com. ...
Yi Wang's user avatar
  • 7,317
19 votes
3 answers
990 views

Generating assignments and transforming code inside held forms when generating code

I have been playing with slightly above trivial code manipulations in Mathematica. I thought Mathematica would be great for this kind of work because of rule replacement and expression manipulation, ...
Manuel Odendahl's user avatar

15 30 50 per page
1
2 3 4 5