Questions tagged [core-language]

Questions on the basic structure of the Mathematica language (Wolfram language) including atomic data types, syntax etc

Filter by
Sorted by
Tagged with
0
votes
0answers
49 views

Is SetDelayed creating Functions?

I was trying to create a named function using a short syntax (I mean avoid writing Function[]). I thought SetDelayed was the short for Function[], but then I had some issues and realized that maybe #x ...
0
votes
1answer
57 views

What's the meaning of TypeSystem`Atom and TypeSystem`Vector?

SemanticImport is probably failing to import the data. In fact the log message is transformed into this weird entity. Dataset[List["Error calling Sogei service http://lb-ven-onl-psqf.winco.local/...
4
votes
1answer
70 views

How can default valued be added in a Query?

I'm not understanding the the default values are not used to produced a length of 0 in the following example. What is the right way to add default values during a query? ...
2
votes
1answer
76 views

Can I tell whether a symbol is build-in (part of the System` library)?

I'd like a function that checks whether a symbol is a predefined part of the language or not. More generally, it might check whether it's part of a given package. ...
4
votes
1answer
83 views

Making a rule that only applies when the expression is NOT an argument?

I know we can make rules of the kind: magic/:f_[x___,magic[a_],y___]:=f[x,arg[a],y] This will replace magic[a] by ...
-1
votes
1answer
243 views

Keywords for the Wolfram Language [closed]

For a programming language, certain keywords are reserved; i.e., these tokens can't be used in any other context while programming in that particular language. Here is a list of C language keywords ...
3
votes
1answer
110 views

Why do these two calls to Apply return different results?

In the following example, why do these two calls to Apply return different results? ...
3
votes
1answer
112 views

Alternatives in pure function construction

When I declare a function f in the following form: f[a|b] := 1 then I can use it like: ...
3
votes
1answer
40 views

Type formation rules for 1-position expressions

I made a summary of the rules for formation of types for simple 1-position expressions, as I understand them. Here it is in textual form: A symbol, say, α, is a discrete entity, represented by a ...
0
votes
1answer
47 views

Debugging code with Plot function. Full details

This is some code: The first plot (with the f[x,3]) gives me a graph. The second plot (with the 'numerical' form of f[x,3] given) does give me a plot How can I fix this so that the first line gives me ...
11
votes
1answer
283 views

What is the relationship between the Wolfram executables? Where is this documented?

The relatively new wolframscript now accompanies the traditional math and wolfram binaries. ...
3
votes
3answers
131 views

How to swap SetDelayed expressions?

Suppose, there are two delayed expressions D1:= RandomVariate[UniformDistribution[{-1, 0}]]; D2:= RandomVariate[ UniformDistribution[{0, 1}]]; ...
1
vote
2answers
73 views

What are the limitations of RecurrenceTable?

Background Consider a recurrence relationship defined in terms of the following recursive functions (which works correctly): ...
3
votes
1answer
70 views

Conditional Output of Solve as a piecewise function

I am solving a set of equations, and Solve gives me (as expected) conditional assignment rules. Now I would like to define a piecewise function with that output, and use both the solutions and the ...
2
votes
1answer
43 views

alternative approaches to selecting elements from two vectors conditional on a third

The following will convey the idea: build a new vector based on an existing condition (boolean) vector. For simplicity, I'll build the conditioning vector (cond) in ...
1
vote
1answer
55 views

Assiging Plot Range to Variables Works For X but Not Theta

Observe the following Mathematica code: ...
0
votes
2answers
43 views

Create list of functions, domains, and iterate over (compare to Python code)

In Mathematica, I want to do a mass export of many different animated plots of specific functions with different domains. Because I don't necessarily want the plots to always have exactly the same ...
1
vote
1answer
27 views

Substitute a function

In the following code, I'm trying to substitute Sin[x] for f[x]. What's the right way to do it so that f'[x] gets replaced with <...
0
votes
0answers
50 views

What is the best way to remove dataset rows with missing values?

Consider a rectangular dataset produced by SemanticImport from a CSV file where the first row has the headers. Some values are Missing. I want to delete all the ...
1
vote
0answers
42 views

Intervals v.s. Domains: when to use which and why?

or: How to use Interval correctly? Mathematica provides these constructs for various symbolic deductions tasks. Among those constructs are symbolic number sets ...
0
votes
1answer
69 views

Strange little bug: Simple real number replaced by Times[0.805`, \.00] [closed]

I had a bug in my code which I tracked down to the simple number 0.805. So I looked at the FullForm of this number and I got Times[0.805`, \.00] It isn't a big ...
1
vote
0answers
83 views

Converting negative value to zero [closed]

I would like to convert the negative outcome of $r_2$ to zero. I have used the following code, but it still gives me a negative value. Is there any option to turn the negative outcome directly to ...
2
votes
0answers
62 views

Should I redefine 0^0 [duplicate]

I've found some times, while playing with combinatorics, that Mathematica can't calculate some functions because $0^0$ is not defined as $1$. (I know that some people think that $0^0$ should be left ...
1
vote
2answers
111 views

'Do' loop acting on a global variable

I need a code that will allow me to alter a matrix (a global variable) iteratively using a function update (which depends on ...
0
votes
1answer
43 views

Expression unexpectedly not evaluating to a numerical value [closed]

When I calculate the below, I get an unexpected output, not giving me the density, but rather a value M * .. ...
3
votes
2answers
70 views

Basic replace with parameters questions

I have looked over MMA SE but seen nothing to help clarify this for me. what I want to do is set some parameters for a curve, and then I want to automatically replace the x,y,z of, say, a vector field ...
17
votes
1answer
355 views

Broken ValueQ function in Mma12.2?

f[x] ^= 1; ValueQ[g[x]] returns True in Mathematica 12.2. Is it a bug?
1
vote
0answers
34 views

How to Inherit Arrowheds size?

I'm trying to write a Module that produces some arrows with custom Arrowhead shapes. However, I want the code external to the <...
0
votes
0answers
27 views

does Mma provide exact critical values of Mann Whitney U (small samples)

Does Mma provide exact critical values for the Mann Whitney U test, along the lines of haskell? Or just as good, for given two small samples, can I easily ask ...
8
votes
0answers
282 views

InLine TeX input seems unstable

In the documentation of version 12.2 there is a new feature to input TeX as mentioned by Stephen Wolfram. See: InlineTeXInput in the documentation. After typing CTRL$ you can type in some TeX, and ...
0
votes
0answers
40 views

The command Total sums the entries of a list, is there a comparable command for the product of entries of a list? [duplicate]

I recently just found out about the command Total that gives the sum of a list. Was wondering whether there's an analogue that gives the product of the entries of a list? I see that there is the ...
1
vote
0answers
76 views

Can you create an indexed list of all Wolfram functions within a notebook? [closed]

Can you create a summary list of all Wolfram functions used within a whole notebook? Searched long and hard- no clear documentation found.
3
votes
0answers
90 views

How do I get built-in functions to use custom objects as if they were e.g. List?

(This is part 2 of my earlier question, Can I overload Part for specific heads (a la overloaded array subscripting)?, which was well-answered as asked.) Overview: My goal is to create a custom object -...
6
votes
1answer
127 views

Undefined Indexed Variable

I searched already a lot about indexed Variables, and it tends to be the most applicable way to use tensor notation. But I am having a hard time to solve for undefined indexed variables: Here my ...
1
vote
1answer
95 views

Can I overload Part for specific heads (a la overloaded array subscripting)? [closed]

Mathematica/Wolfram Language newbie here. The behavior I am after is to be able to "overload" the subscripting of me-defined objects/Heads and thereby use them as if they were ...
2
votes
0answers
25 views

Should `DiscreteLimit` work when the argument type is specified?

Is it expected that DiscreteLimit fails to evaluate whenever the argument type is specified? E.g., ...
0
votes
1answer
69 views

Computmg the powers of a complex number? [closed]

this is the complex number im dealing with zb=(1/7)* (Cos[Pi/3]+I Sin[Pi/3]) I need to represent for the first 10 powers in the plane. I also need to label the ...
0
votes
0answers
69 views

Why does Log[Abs[#]] return a complex number?

For a nonzero number $x$, $\log|x|$ should be a real number. Why does the following NestList contain non-real numbers when no numbers involved are close to zero? Is it a bug? ...
1
vote
0answers
42 views

How to eliminate a variable from coupled ODEs?

I found this question with an answer: How to eliminate variables in ODE? ...
4
votes
3answers
291 views

How to programmatically modify a function definition

I would like to know an efficient method (without converting Mathematica Code to strings and string processing) of modifying a function definition programmatically. For example, I would like to tidy ...
2
votes
0answers
91 views

Why Does Subsets[...,{n}] not Output a Packed List, Even Though it Doesn't Unpack?

Assume list is packed. I expect Subsets[] is a structural operation because it depends on the number of elements, not on what ...
0
votes
1answer
25 views

Speak misses words when executed first time in new cell

Version->12.1.1 for Microsoft Windows (64-bit) (June 19, 2020) ReleaseID->12.1.1.0 (6959458, 2020061902) PatchLevel->0 When I evaluate for the first time in a new input cell: ...
3
votes
0answers
194 views

Vector arrow notation in Mathematica

I want a fast way to type vectors in Text boxes like this: $\vec a$ I can do this manually with ctrl+7+"-> " which creates this ...
11
votes
2answers
251 views

i_:0|1 varies in v12.1: incompatible change or bug?

Just check i_: 0 | 1 // FullForm In v12.0 or earlier the output is Alternatives[Optional[Pattern[i, Blank[]], 0], 1] But in ...
0
votes
0answers
49 views

Extention of Times operation causes bug in Expand?

I have the following code in Mathematica 11.01 : ...
2
votes
1answer
46 views

Splice matching function arguments

Mathematica 12.1 introduces Splice that replaces the old way of using Sequence@@ to "melt" a list of entries. However, the ...
1
vote
1answer
226 views

How do I evaluate my functions over a range of values? [closed]

I want to use the list of data which will come from MapData1 (in code); the first element is θ and second is Action(I). I want to use this Action(I) and Angle(θ) in ...
3
votes
1answer
48 views

Evaluate a Number head as a constant function

I wanted to use the parameters of a function in a distributive way, so for example In[1]:= Through[(Cos+Sin)[x]] Out[1]:= Cos[x]+Sin[x] It works without problems ...
1
vote
1answer
37 views

Help with Evaluation controll/hold all attributes?

I'm making a sort of symbolic derivator, which needs to take its formulas in unevaluated form. ...
1
vote
0answers
43 views

If it possible to define a "function" such that the normal form will have the arguments in order? [closed]

I'm looking for something that acts like this. How could ord be defined for 2 arguments? What about n? Since Mathematica is a term-rewriting system it should be possible, but all my attempts were ...

1
2 3 4 5
11