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

learn more… | top users | synonyms

0
votes
1answer
128 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 ...
4
votes
0answers
115 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 ...
5
votes
2answers
324 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 ...
5
votes
2answers
322 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 ...
1
vote
1answer
90 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 ...
1
vote
2answers
261 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. ...
2
votes
2answers
98 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 ...
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: ...
0
votes
1answer
211 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
1answer
74 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; ...
0
votes
0answers
75 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 ...
0
votes
2answers
160 views

How can I improve Do loop?

I have very large input of time series data (over 30000 observations) that look like as follows: ...
6
votes
2answers
179 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
126 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 ...
0
votes
0answers
36 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
100 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" ...
2
votes
3answers
117 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
120 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
451 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
510 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
102 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): ...
0
votes
2answers
109 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 ...
0
votes
4answers
194 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 ...
0
votes
1answer
337 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: ...
2
votes
3answers
306 views

find connectivity

Imagine a chain of 20 rings, labeled by 1-20 sequentially. We want to make random size sets of numbers randomly chosen from these 1-20 rings. No duplicate numbers are allowed. Example of a set: ...
9
votes
0answers
219 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
232 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 ...
1
vote
0answers
70 views

Distinction between 2 NETTypeInfo answers

In a NETLink application I checked all the types offered by LoadedNETTypes[] according to the following: ...
0
votes
1answer
137 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], ...
0
votes
2answers
187 views

How to find intervals in the domain corresponding to intervals in the range?

I want to find the intervals for the argument m1 of this function corresponding to the value for the function lying in given intervals of the range: ...
0
votes
1answer
165 views

Please explain this code (contains Append, Do, Coefficient)

I am a graduate student using a past student's Mathematica program. Will someone please explain to me exactly what this piece of code is doing? Specifically the ...
2
votes
2answers
143 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
111 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
170 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?
1
vote
3answers
421 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
98 views
14
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 ...
-1
votes
1answer
73 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
123 views

Loop function question [closed]

I'm new to Mathematica. Below is the code I have trouble with. ...
0
votes
1answer
76 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. ...
0
votes
0answers
52 views

Display functions without dependence?

I'm solving systems of equations with a few different functions of time, t, and so I'm getting output with lots of [t] running around. Is there a way to display these functions without the ...
0
votes
2answers
261 views

Defining a function in terms of matrix elements

Currently trying to use elements from a matrix in defining a function however having some trouble. This is a somewhat simplified version of the problem. Say I have the matrix ...
0
votes
1answer
43 views

Showing result of derivative and other functions [closed]

I have a problem with my Mathematica 7.0 When I write: Derivative[x^2, x] Mathematica returns as result : ...
15
votes
2answers
747 views

Why do certain values in ArcSin not fully evaluate?

This is a continuation of: Why do certain fractional values in TriangleWave not evaluate? The analysis by R.M and rasher revealed that problem to reduce to the behavior of: ...
0
votes
0answers
20 views

Incorporating Built-In Function Options/Parameters into Shorthand [duplicate]

Shorthand syntax provides an alternate way to apply functions and, in many cases, improves readability. A simple example would be ...
0
votes
1answer
88 views

How to distinguish expression from zero [closed]

my question is the following. I have an array, which elements are functions (say, sines of symbolic arguments). Some of the elements are zeros. I want to write code like: ...
1
vote
1answer
135 views

Is linear interpolation applicable here

From my understanding about Linear Interpolation especially of that of Newton's Divided Difference Polynomial, we could get the value of F(x) from the given set of ...
0
votes
1answer
50 views

Extend a function defined for integers to a differentiable function of a real variable

Here is a function that calculates the probability of randomly landing on a Fibonacci number not greater than $n$: ...