Tagged Questions
1
vote
1answer
54 views
Mathematica plots a discontinuity in piecewise function that does not exist [duplicate]
I have the following function defined:
...
9
votes
2answers
143 views
How can I get the right hand side of a delayed expression?
Imagine there is a given function f, defined with SetDelayed, say
f[x_] := Sin[x]^2 + Cos[x]^2.
Is it possible to get rhs of ...
0
votes
1answer
172 views
How can I define a Step-Wise function in Mathematica (Not using Heaviside Step Function)? [closed]
I need to define a function, which has very different behaviour in different regions. There are about 13 different regions. A sample of my function is the foloowing table:
I want to define it as a ...
1
vote
1answer
124 views
Why does the first derivative of a piecewise continuous function turns out with discontinuities?
I have this piecewise continuous function which is also continuously differentiable over time :
...
15
votes
4answers
235 views
Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs
Using global variables the following turns an "expression" into a Function:
expr = 2 x;
Function[x, Evaluate[expr]]
Of course ...
1
vote
0answers
71 views
How can I obtain the function described by given set of central moments?
I want to investigate how my function P behaves with different probability functions rho as input variables.
This means
...
1
vote
1answer
100 views
Function definition and delayed assignment
I need to define the following function
MyWavelet[n_]["PrimalLowpass", prec_ : MachinePrecision] :=
Table[(-1)^(j - 1) h[[2*n - j]], {j, 0, 2*n - 1}]
which ...
4
votes
3answers
89 views
Creating a nonperiodic function in mathematica
I want to create a non-periodic square wave with values of 1 and -1(not necessarily alternating).
For e.g. I want to convert an arbitrary array like {1,-1,-1,1,-1,1,-1} into a function.
I tried ...
3
votes
1answer
109 views
Downvalues vs. Scoping for Functions
Regarding my recent question on using a default value for a function argument when a pattern was not met yielded some interesting answers, but the general consensus was "Yes this can be done, but ...
6
votes
4answers
170 views
Function argument to default under certain condition
Inspired by this and this question (and how I handle this in practice), what is the best way to default a function value when a certain condition is met?
For example, if a function is defined as:
...
2
votes
0answers
57 views
From notebook,how can I change variable value with in .m file dynamically?
I wrote a function named Testing.
...
3
votes
1answer
67 views
Values set using SetOptions are staying in the kernel, beyond the necessary time [closed]
I wrote a function name as functionTest and also mentioned default Options.
...
10
votes
2answers
196 views
Functions that remember their values
Can someone explain what is going on with the following ...
func[y_] := func[y] = (Print["Hello world !!!"];)
func[1]
Hello world !!!
...
0
votes
0answers
52 views
Enable syntax-coloring on user-defined function [duplicate]
Possible Duplicate:
Syntax highlighting for your own functions
I have defined a function myIntegrate that carries out a routine similar to Mathematica's ...
7
votes
4answers
286 views
Is there a concise form of Which or similar conditional?
Suppose that I want to write a function fun that takes an Integer num as input, and returns ...