Skip to main content

Questions tagged [localization]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
0 answers
74 views

Most efficient way to define several local constants in a function -- Block or nested Withs?

Sorry if this is kind of a noob question but I'm wondering what the best-performing approach is to the following: I'd like to define several local constants in the body of a function, each of which ...
max's user avatar
  • 111
1 vote
1 answer
91 views

Is there a way to import GPS height-position data from a navigating vessel in real time to Mathematica?

After reading this, I found that Mathematica could be a useful tool to analyse GPS data from a navigating vessel at sea. But this example is for land-based fixed positions, i.e. the position of a lake ...
Superunknown's user avatar
5 votes
1 answer
89 views

Automatic scoping of input to function

I'd like to write a function whose arguments contains symbols that are automatically localized, just like some built-in functions, like Sum. Even better, I'd like to see the symbols' color change, to ...
Ben's user avatar
  • 53
5 votes
1 answer
219 views

Is it necessary to use Print inside a Block? [closed]

If I use a Block with variables already used and ask it to Solve an equation inside the Block...
RoberRM's user avatar
  • 339
3 votes
1 answer
107 views

Let Monitor show the result returned by Module?

I wrote a simple solver to solve an equation with two parameters a and b. At the same time, ...
Enter's user avatar
  • 1,229
1 vote
1 answer
167 views

Accommodating local variables within Dynamic

I would like to use a local variable within Dynamic, but that may not work, and the front end will show the local variable in red to give a warning. However, if I ...
Russ Lyons's user avatar
2 votes
1 answer
323 views

When a list is not a list [closed]

When I provide a list of local variables to Module, it complains that it is not a list: v = {x, y}; Module[v, x = 2] ... Module: Local variable specification v is not a List. So my question is how do ...
pion's user avatar
  • 21
0 votes
1 answer
66 views

Manipulate: variable localization inside nested `Control`

Below is a piece of my code I have trouble with: ...
user45937's user avatar
  • 1,291
11 votes
1 answer
241 views

Proper Syntax highlighting for multi-argument With?

For the case of Block and Module one can choose to define values in the body for the variable names being scoped. So there is no ...
user13892's user avatar
  • 9,443
0 votes
0 answers
52 views

Creating functions that ignore if a variable is already set [duplicate]

I have noticed that there are functions in Mathematica that are ignoring already set parameters. I.e. Plot: ...
Lars H.'s user avatar
0 votes
2 answers
38 views

Dropping \$NUMBER from local var$number when passing results from a Module [duplicate]

I'm sure this has been asked, but I can't seem to find the correct terms to find it. I have a function that looks something like this ...
mikemtnbikes's user avatar
8 votes
0 answers
95 views

Multilingual code captions for user functions

Mathematica 11 features multilingual code captions for built-in symbols. How do I define code captions in different languages for my own functions which may go into a Mathematica application/package?
QuantumDot's user avatar
  • 19.7k
8 votes
1 answer
255 views

How does Context work? [duplicate]

I thought when we type a symbol without specifying its Context, it will search all the Context in ...
vapor's user avatar
  • 7,921
2 votes
2 answers
219 views

How to scope variables in Manipulate (for Autorun)

This question is connected with that one (and all other connected). The purpose is to make a demonstration that has a Dynamic part among controls (I'm aware that it is not recommended, but nonetheless....
garej's user avatar
  • 4,865
7 votes
2 answers
368 views

What evaluation mechanism is behind Mathematica support for multiple definitions of a function? What is the benefit of this?

I am studying the question What are the most common pitfalls awaiting new users? Up to now, I have fulfilled some of the parts but yet don't understand which this problem is related to? Consider the ...
Sepideh Abadpour's user avatar
3 votes
2 answers
144 views

How can I adjust the global input variable of a function to the value of a local variable within the function

I am trying to define a function f[l_] that will perform an operation on whatever input variable I use (normally I use l which ...
Andrew's user avatar
  • 31
5 votes
2 answers
243 views

Conflict with variables in pure functions

Consider the following snippet of code. Clear[f, g] f[x_] := Function[{i}, x]; g[h_] := Module[{Z}, Z[i_] := Print[h]; Print[h]; Z[1]; ]; When ...
anon's user avatar
  • 53
6 votes
1 answer
784 views

Compile, "global variables" and recursion

I am trying to do something similar to this, namely to make a Compile'd function outer that itself calls a ...
Marius Ladegård Meyer's user avatar
5 votes
3 answers
1k views

Customizing decimal mark used in plot frame tick labels

I am using the Plot function in a usual way. I use Mathematica 9.0.1.0 in English (I do not know if it is available in other languages, but I do not mind), and as a ...
Vicent's user avatar
  • 1,101
3 votes
1 answer
140 views

How to localize symbols on the right-hand side of Rule when using ReplaceAll? [duplicate]

I am frustrated by the following: {1, 2, 3.0} /. a_Integer -> a + 1 The a on the left side of the arrow is localized and ...
eldo's user avatar
  • 75.2k
6 votes
1 answer
318 views

Is it possible to get AltGr key to work in Math.exe?

For some reason when you run Math.exe form windows command line, Mathematica disables the AltGr key. This is a bit annoying since my keyboard locale has the keys [, ], {, }, @, $, \, | located under ...
joojaa's user avatar
  • 780
0 votes
0 answers
59 views

RandomReal behavior in Block environment [duplicate]

I ran into an unexpected behavior of RandomReal function inside the Block environment. If I simplify my problem: I wanted to use two random local variables, such that the second one would be less that ...
Liz's user avatar
  • 151
0 votes
0 answers
190 views

Block, With, Module, can anyone help me understand the distinction? [duplicate]

I've been working heavily with Block[] for months in my research so I've read the documentation for the seemingly similar commands With[], Block[], and Module[]. Personally, I've had by far the ...
Steve's user avatar
  • 1,153
4 votes
2 answers
1k views

How to declare a function that uses local variables of a module outside this module?

I have the following code Module[{f,x=0}, f[t_] := x + t; ..........; ...f[1]...; ..........; ] My aim is to put the declaration of the function ...
Vahagn Poghosyan's user avatar
2 votes
1 answer
365 views

Reuse local variable in declaration within With [duplicate]

Considering the richness of Mathematica.SE, I am quite surprised I could not find my answer... I am very sorry if it is a duplicate. Consider the following example: ...
max's user avatar
  • 1,585
3 votes
0 answers
3k views

Cannot save file

Hello I have a problem in saving files in Mathematica. I can't save not only notebooks but also figures. When I choose to save the notebook it open a window that says: Mathematica could not find ...
2island's user avatar
  • 85
2 votes
1 answer
232 views

Is there a convenient way to localize all variables in a new notebook? [duplicate]

I often digress to test some others’ code when working on my own problems. Usually, I have to check if there are conflict variables. Of course, it is not a wise way. By contrast, all the variables in ...
luyuwuli's user avatar
  • 2,814
5 votes
1 answer
137 views

DateString and localization, $Language ignored

I have a DateString calculated in English. Now I would like to change the output according to localization. I have read that localization is possible for Menu, ...
Frank's user avatar
  • 353
10 votes
4 answers
1k views

How do I change the way Mathematica pronounces English words (e.g. "futile" is not pronounced correctly)?

I am absolutely desperate. I cannot get my Borg to pronounce "futile" correctly. Speak["Resistance is futile."] Leo pronounces "futile" as expected and there is ...
Ernst Stelzer's user avatar