Questions tagged [arguments]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
4answers
106 views

How do I pass a “list of lists” as the argument to a function of the form F[x,y]? [duplicate]

I have a function F[x,y] and a list of the form: {{a1,b1},{a2,b2},{a3,b3},{an,bn}} Basically, I want to pass the list ...
1
vote
1answer
51 views

Run a shell script and pass arguments from inside mathematica

Is it possible to run a shell script AND pass it arguments from Mathematica? I have searched thoroughly and been unable to find a way to do this. I want to avoid having to write a .wls for this ...
0
votes
0answers
12 views

Operating functions with two arguments? [duplicate]

Let us first consider function with single argument. f1[x_] := x^2 The value of function at any value of $x$, for example, $x=3$ can be evaluated with any of the ...
0
votes
1answer
50 views

How to plot a scalar function with a vector argument? [closed]

I'm trying to take a simple dot product of two vectors and plotting it as a 3D density plot. However, I don't know how I should define the limits of the plot if the argument of the function is a ...
10
votes
2answers
726 views

Define function that behaves almost identically to Mathematica function

Often I like to define my own functions that are almost exactly the same as Mathematica defined functions, apart from a few tweaks. See this question for example. I want to define them properly so ...
1
vote
3answers
102 views

Pass arguments to a function within a function within a function

I want to perform an integration of f[w,t,kx,ky] over t for several different functions f. ...
1
vote
3answers
75 views

How to make functional rules not depend on an argument?

Consider the following: rule = f[x] -> Sin[x] if I now do, say: f[y] /. rule this does not work, because the rule wants ...
0
votes
0answers
30 views

How to automatically see user defined function arguments list?

Having typed a user-created function's name I would like to be able to see either the concise syntax dropdown available for inbuilt functions (shown below left) or alternatively to be able to see the ...
1
vote
0answers
50 views

Selecting the 1st and then subsequent elements in an expression [closed]

I'm using a mixture of Span and Part to try and extract the arguments of a function that I need. I'm using a function such as $...
0
votes
0answers
43 views

Define a new Front End Syntax for Function Argument Checking & Debugging

In this question I asked a basic question about how to check argument types such that there was useful output from the front end when calling functions. Based on elements of the nice answer by @j-m-is-...
16
votes
1answer
184 views

How can I view the minimal required arguments of a Wolfram Language function?

This question might be a bit of an overstretch, or really obvious, but I haven't been able to find an answer yet. Is there a way to automatically view the minimum required arguments for a WL function?...
0
votes
0answers
42 views

Editing the function argument

I'd like to construct a function, that changes its own input. The code ...
1
vote
0answers
42 views

An argument which returns the function that is applied to this argument [duplicate]

Is it possible to construct an argument such that any function applied to this argument returns itself, i.e. (the slot is used to allow for additional arguments in the function) ...
0
votes
0answers
44 views

How to speed up a module function with a large number of arguments?

I'm setting up a fairly hefty numerical code dealing with matrices of variable dimension, but on the order of hundreds of rows and columns. I'm using a Module format: ...
0
votes
0answers
38 views

Imitate Integrate's behavior with regard to the integrand parameter (scoping/naming)

Using Integrate, I can do any of the following: ...
1
vote
1answer
79 views

How can I code the Bernstein operator in Mathematica?

Given a function $f(x) \in C[0,1]$, we define the $n$th Bernstein Operator $T_n$ by $(T_nf)(t) = \sum_{k=0}^n {{n}\choose{k}}f\left(\frac{k}{n}\right)t^k(1 - t)^{n - k}$. I'm trying to code this in ...
0
votes
1answer
83 views

passing system of equations as argument

I am trying to solve a 6-equation system with one self-built function. Problem is, 3 equation must be passed as argument while the other 3 are defined inside the function. I am quite new with Wolfram ...
0
votes
1answer
67 views

Find coordinates of intersection of two InfiniteLines

I have a couple of lines described by InfiniteLine and I need points where two different pairs of them intersect: ...
2
votes
1answer
77 views

Testing if list elements are numerical

I want to define a function with an argument, which is a list: m = 10; a = Table[k,{k,1,m}]; TestFun[listArg_] := Sum[listArg[[k]],{k,1,m}] Now if I run the ...
-1
votes
1answer
144 views

How I defined a custom function with over 100 parameters

EDIT: To make this question clear, I am editing it again. I'm new using Mathematica, so hope it's not a stupid question. I have large numbers of parameters in my custom function, like e1,e2,...e100. ...
1
vote
0answers
47 views

How to handle functions with varying number of arguments

Suppose I have a function that depends on variables $x_1, ... , x_n$. For concreteness I may have $f(x) = v \cdot x$, with $v$ a certain vector. Now I want to do certain operation with this function, ...
0
votes
0answers
46 views

Using non-standard arguments in defining functions

I am trying to define a function that has a non-standard argument (i.e, UnderBar[a]_) instead of standard arguments like English or Latin Letters: Here is my example: ...
1
vote
3answers
385 views

Pass function or expression as argument to be evaluated

I'm trying to create a function using Nest, which will use Newton's method to find the root of the passed function (or even the passed expression). I've got this, which won't work obviously. ...