0
votes
1answer
29 views

Why would this function work only when I make a copy of the variable? [duplicate]

Why would this function work with a copy of the function variable: ...
4
votes
1answer
71 views

How do I constrain variables to a user-defined domain in ArgMax?

I am trying to ArgMax a function over x, but x is only defined between ...
2
votes
1answer
102 views

Define function that counts recursive fibonacci

If I write count=0; fib[0]:=(count=count+1; 0); fib[1]:=(count=count+1; 1); fib[n_] := (count = count+1; fib[n-2] + fib[n-1]); Then I can ...
1
vote
2answers
111 views

Define the square of a function [closed]

Is there any good way to define the square of a function in M9? Usually one can write e.g. f[z_] = 3*Sin[z] etc etc. But is it possible to define ...
0
votes
1answer
62 views

How I can define a new function as a function argument?

I need to pass a function with t as independent variable as a function parameter and want to create a new function of the same through this provided the argument of another function. Here is my code. ...
0
votes
2answers
114 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
2answers
102 views
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. ...
1
vote
1answer
137 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 ...
10
votes
4answers
478 views

Refering to global variables inside modules

How do I refer to global variables inside modules if the same name is used for a local one? In code, I want that ...
2
votes
1answer
83 views

What is the need for function parameters? Many possible inputs

If I have many possible variables related to one another, why do I need to define my function with parameters for plotting? For example, if I have an equation like: ...
6
votes
2answers
355 views

Obtaining the name of a variable as a string [duplicate]

Suppose that I have an arbitrary variable myVariable. Is there some function fun -- either built-in or one that I can define -- ...
3
votes
1answer
231 views

Evaluating a function on permutations of its arguments

Say I have a function "temp" of $n+1$ variables, $y,z1,z2,z3,...,zn$. I want to test if my function has certain symmetries like swapping $y$ with square of any $z$, swapping any two of the zs, ...
1
vote
1answer
302 views

How to substitute variables in interpolated function?

I'm looking for the way to substitute variables in interpolated function again to original one. (I want to know how to get P(r, theta) from Psol(v, w).) The original variables : ...
6
votes
2answers
262 views

How to choose variables from a list for a function and then use the solution in a subsequent function?

I am trying to calculate heating degree days and cooling degree days and output that information to a table. I am using mathematica's curated data to do this. In text this is what I would like to ...
9
votes
3answers
354 views

Problem when defining variable in Mathematica

I'm trying to run this: domain := {n, 0, 10}; Plot[n, domain] but it doesn't work. Instead, it generates the message ...