Linked Questions

1
vote
1answer
115 views

Subscripted variables give errors in Module expression [duplicate]

I have following problem. I want the R not to calculate before the integration but substitute later as a function of z. My Mathematica codes look like: Codes like big, (sorry) but most of them ...
2
votes
1answer
107 views

How to define an auxiliary function within a function [duplicate]

I would like to define a function within a function to serve as an auxiliary function. In essence, something like this: f[x_,y_]:=Module[{g[z_]:=2z},x+g[y]] ...
0
votes
0answers
280 views

Module: local variable specification error [duplicate]

I am developing a module which does some vector algebra, and I have added an image of the code in the link below. (I did not find a good way to add formatted code in this pane). If the image ...
1
vote
1answer
53 views

Function definition with sub (super) cripted variables [duplicate]

I like using subscripts a lot. However, it is regrettably not possible to do, for example: myfunction[Subscript[x,1]_] := Subscript[x,1] +1 where instead of the ...
455
votes
37answers
101k views

What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...
220
votes
8answers
13k views

What are the use cases for different scoping constructs?

Mathematica includes three functions that I know of which can be used to effectively (if not actually) define a variable and give it a value within a local scope: ...
44
votes
1answer
856 views

What does Internal`InheritedBlock do?

What does the function Internal`InheritedBlock do? How is it different from the regular Block?
27
votes
2answers
667 views

What is the purpose of Internal`LocalizedBlock?

I have come across the (internal) use of the function: Internal`LocalizedBlock I am trying to determine its purpose. It seem to behave like ...
24
votes
1answer
8k views

Module with “local functions”

I am trying to use a Module having "local functions", i.e., those which I need to define only inside this module. So I tried this: ...
6
votes
6answers
4k views

bar and hat only apply to certain letters

(I'm navigated from stackoverflow.com where I asked almost the same question) I'm a beginner in Mathematica. Like shown in the image below, I'm trying to put hat ...
7
votes
2answers
678 views

Plotting 2-D Electron Density Carbon Atoms

I need to create a 2-D electron energy density plot in Mathematica to compare with my STM experimental results in my lab class. This would be done by plotting the sum of the symmetric and anti-...
1
vote
2answers
438 views

3D plot of multiple functions

I am just starting to learn Mathematica. I defined two functions Subscript[x, 1][t_, α_] :=1/2 (3 - 2 E^-t + E^t (2 + t) (-1 + α) - α) And ...
0
votes
1answer
686 views

How to implement the for loop to replace text strings or texts?

I wonder define a bunch variables named like $X_1$, $X_2$, $...$, $X_n$. Is there some smart way to declare them instead of by pure typing. One trick I can image is to use the for loop,...
0
votes
1answer
541 views

Getting mesage: Set::setps assignment is not a symbol

Please, tell me what is the issue with the following code? Dimensions[Subscript[R, 2]] {201, 161, 53} ...
1
vote
1answer
70 views

How to make subscripts from list?

I want to make list of subscripted symbols in functional way. So that given edges list I can get something like the list below/ ...

15 30 50 per page