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

learn more… | top users | synonyms

0
votes
1answer
77 views

Log is not being evaluated inside Grid [closed]

My command is: Grid[{{N, logN!, N log N - N}, {10, Log[10!], 10 Log[10] - 10}}, Frame -> All] In the second row of the grid, the function ...
2
votes
1answer
59 views

Why is left NumberPadding always applied in NumberForm?

I would like to display numbers like 9.0001 and 10.0001 in the fixed-width form of xx.xxxx. ...
0
votes
1answer
116 views

Finding equation of tangent line at a point [duplicate]

my function is defined as f[x_] = x^1.1 - 2.5 x^.5 I need to find the equation of the tangent line to the curve using the point slope form which would be something like f'[a][x+a]+f[a] a=1 and x=1 ...
0
votes
0answers
22 views

Question about a ParametricPlot with a shading grey family of lines and/or different sizes [duplicate]

So, I have this function of the polar angle $\theta$, with a varying parameter $t$: {Cos[\[Theta]] (1 + Sin[t]), Sin[\[Theta]]} and I want to draw it in a ...
2
votes
2answers
90 views

Testing for arbitrary algebraic expression in given variable

I want to test, for example with MatchQ, if the argument of a function is an arbitrary expression in a single or several variables whose names can be assumed to be ...
4
votes
0answers
111 views

Can Mathematica Operators be combined in a linear fashion for readability?

Here's a simple example. Suppose we want to find the off-diagonal matrix of m: m={{1,2},{3,4}} This can be solved fairly simply by extracting a list of the ...
4
votes
2answers
304 views

Define a function with a function for an input

I want to create the functions $even[f]$ and $odd[f]$ which will apply the formula $even[f(x)] = \frac{f(x)+f(-x)}{2}$ and $odd[f(x)]=\frac{f(x)-f(-x)}{2}$ for an arbitrary $f$. I tried using ...
20
votes
1answer
378 views

What is PointForm?

I stumbled across a function called PointForm but the only documentation I can find is the pop-up line offered by autocomplete, which contains the same information ...
1
vote
1answer
120 views

Perform FindRoots on Function Evaluation Containing RootSearch

I am using Ted Ersek's RootSearch function in Mathematica 9.0 (http://library.wolfram.com/infocenter/Demos/4482/) to create a function that I am using for graphing. ...
5
votes
2answers
276 views

Quickly calculating the mean / median of a function over an interval

I'd like to calculate the Mean or Median value of a function over some interval $[a,b]$. However, I can't seem to find how to do this in help. Specifically I'd like to have something that works like ...
0
votes
1answer
160 views

Is it possible to convert expressions containing Root objects to Excel formulas?

I am still a beginner and do not fully understand pure functions and root objects. When I tried to calculate the inverse of a function, Mathematica gave me: ...
1
vote
2answers
211 views

Multiple curves plotted with different colours [duplicate]

I am trying to use ColorFunction for 2 functions on the same plot. I only want the cubic equation to change colour. ...
1
vote
1answer
87 views

How can I check if one expression implies another?

Say I have one expression, for example $x^3-3 + c = y$, and I want to check if it implies another with some set of explicitly stated assumptions. With the previous example, assuming all variables are ...
0
votes
1answer
185 views

Pass unevaluated function with evaluated arguments

I am almost sure that this question has been asked somewhere. I found similar ones, but I cannot find exactly what I need, which might mean that I am on the wrong track. I search a method to pass an ...
0
votes
0answers
41 views

Using Table[ ] vs using Do[Append [ ] ] [duplicate]

Is it generally better/faster to use the Table function over using Do[Append []]? For example, I have this piece of code: ...
2
votes
1answer
565 views

How could I define a function as the solution of equations in Mathematica?

I have posed a specific question yesterday but it may be too trivial to answer. I think the question could be asked in a more general way so it is easier to answer. Then I could solve the original ...
0
votes
1answer
73 views

How to write series of Do[ ]'s with a single Table[ ]?

Edited to provide more information (sorry I don't know how to format matrices here) I would like to replace: m = 4; ...
3
votes
1answer
213 views

Help on how to write a function to be used with NMinimize

I need some help to write a proper function to be used as a parameter on NMinimize. Here is the code of the function to be minimized (Please correct, optimize and rewrite the code if you want to - I ...
0
votes
0answers
72 views

Using Reduce on an inequality

I have been evaluating this formula, $\frac {3^r - 1} {2^r - 1}$ for $r>1$. The numerator is always even and the denominator is always odd. I am trying to show that the denominator will not ...
0
votes
0answers
52 views

Generating Suffixes [duplicate]

I am doing a large Matrix calculation in which I need to generate symbols first like $F^{\mu\nu}$ I would like to get $\mu\nu = 00, 11, 22, 33$ and so on. I need to have the symbols before I can ...
6
votes
2answers
174 views

Evaluation in lambda function

If I have a function, that returns a function, for example: f[a_] := a^2 * # & then f[3] == 3^2 # & Is there a way ...
1
vote
1answer
114 views

How to define a summation with function calling itself?

I am new to Mathematica. I want to do this f(x)=summation f(t), summation is over t, where 1<=t<=x-1 and mod(x+1,t+1)=1, i.e. when x+1 is divided by t+1, remainder is 1 and f(1)=1. Should i use ...
4
votes
5answers
1k views

How to sum over a List

list = {11.5575, 11.397, 5.52734, 4.0878, 2.54815, 1.86652, 2.55028, 2.14952, 1.6242, 1.34117} I have a list of numbers. How do I make a function that creates a ...
0
votes
0answers
33 views

How to plot image of a complex function with a given domain [duplicate]

I've been trying to figure out a way to either draw a curve in the domain of a complex function in one plane and then show the result in another plane (simultaneously?). Actually, just plotting ...
0
votes
1answer
93 views

Integration of DiracDelta

I just came across the following curiosity and I'm not sure whether it's a bug or just me missing something. Here's a minimal example: I defined the following "function" ...
7
votes
3answers
527 views

Inverting a function in a certain region

InverseFunction works well for globally invertible functions, like f = 2*# + 2 &; InverseFunction[f] ...
2
votes
3answers
116 views

Creating a function as a table of derivations

Suppose I have function, which is in fact a list of $n$ functions with $n$ parameters f = {#1 + #2^2 + #3^3, #1^2 + #2^3 + #3^4, #1^3 + #2^4 + #3^5}& I want ...
0
votes
2answers
119 views

How to display output as symbols?

I have this piece of code which populates a matrix following different rules depending on row and column number: ...
3
votes
3answers
436 views

For-loop not working as I expect

I want to do this: When 10 <= t < 130, give t -> 1; When 130 <= t<300, give ...
4
votes
3answers
391 views

cross-correlation with time lag

I have two lists with some data. a={1,2,3,4,5} b={5,4,3,2,1} Now I want to compute the cross correlation of the two lists with a time lag of 1, like it is ...
0
votes
2answers
96 views

Handling output that was returned unevaluated from a function

When evaluating functions, including those described in this post, how do Mathematica users handle values returned from a function that are unevaluated? For example (based on 1): ...
1
vote
3answers
392 views

Generate random points in a region with higher probability in a sub-region

I am trying to generate random samples of points in the unit square in such a way that points inside a given circle are twice as likely to be selected as points outside that circle. I tried to ...
0
votes
2answers
103 views

Define a function on a parameter argument set to zero

Say I have an expression (matrix) that depends on several variables. f= {{a, b+c},{2a-b^2,c^5+a b}} I want to define new matrices with the single parameter ...
1
vote
0answers
69 views

Distinction between 2 NETTypeInfo answers

In a NETLink application I checked all the types offered by LoadedNETTypes[] according to the following: ...
0
votes
4answers
168 views

Evaluate function from a table

I want to define list of functions and also use them for evaluation. But this just doesn't work. For example ...
2
votes
1answer
102 views

Declaration of variables in large Linear Programming model with NMaximize

I want to solve a large LP problem using NMaximize. This is a small instance of my bigger problem: $$max \sum^{4}_{t=1}(\sum^{4}_{c=1} V_{c}*f_{c,t})\\ s.t\quad ...
0
votes
1answer
254 views

How to properly substitute values into variables?

I have an array of functions in terms of a[0] through a[n] and I wish to replace the a[]'s with previously calculated values p[0] through p[n], as in below: ...
0
votes
1answer
132 views

Extract information from function definition returned by DefineDLLFunction

I have an application using DefineDLLFunction whose output is: Function[Null, If[NETLinkDLLPrivatecheckArgCount["DRV_AOVoltageOut", {##1},2], ...
9
votes
0answers
206 views

How is the mysterious Raw function used?

I have never seen an example use for the mysterious Raw function: Raw[h, "hexstring"] constructs a raw data object with head h, and with contents ...
1
vote
1answer
225 views

Detecting a nonlinear edge in a 2D point pattern

Following an earlier post here, I have generated a point pattern on the unit square $[0,1]\otimes[0,1]$, which is described by a piecewise constant intensity function constructed so that (in ...
2
votes
2answers
131 views

how to get a linearized curve in some intervals

in below picture I draw a graph base on weight of a controller system against cost function. I want to linearise and divide this curve to for example 5 five intervals. is there any function in ...
3
votes
1answer
107 views

Count the number of sqrt and 4th powers in a function

This is a simple and short question. I have a function which contains a certain number of square roots and 4th powers, lets take this one: ...
2
votes
2answers
163 views

ImageDifference. Is there an ImageSame, or how would one do that?

Is there an inverse to ImageDifference? What in two images are the same?
13
votes
4answers
1k views

Moving maximum function?

How can I construct a moving maximum function? For example, if I have a list of 12 values: { 5, 6, 9, 3, 2, 6, 7, 8, 1, 1, 4, 7 } and I want to maximize over 3 ...
0
votes
2answers
88 views
-1
votes
1answer
71 views

How to specify a specific range for a loop?

I'm having trouble with setting up a particular range in a loop for my programming. Now I have a defined range of data (not continuous numbers) that needs to be applied in a loop. Since the aim for my ...
0
votes
1answer
122 views

Loop function question [closed]

I'm new to Mathematica. Below is the code I have trouble with. ...
2
votes
4answers
210 views

Find time since last 0 in list

When I have a list of data (measured per day), is it possible to define a function that gives the nr of days since the data has been 0? I tried working with...
0
votes
1answer
71 views

Circumventing the default scoping: Assign a variable inside a function [duplicate]

I'm currently trying very hard to assign a variable inside a function. Therefore I'm using a function like this, which should reassign a predefined variable. ...
1
vote
1answer
161 views

FindMaximum inconsistency

The code below seems to work for n<11. But for n=11, and above, it outputs newa then just outputs "beep" sound. WhyTheBeep says "The kernel Local has quit ...