The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
48 views

Subsituting expressions for expressions

I'm trying to define functions using other functions, like so: f[a_, b_] := a/b; a[c_] := c; b[d_] := d; Now what I want to be able to do is two things: ...
1
vote
1answer
49 views

What is the correct idiom for mapping a 0 value in a modulo n expression back to n?

What is the correct idiom for mapping the $0$ value in a modulo $n$ expression back to $n$. For example if I want to be sure that any integer value maps back to the index for a character in the ...
4
votes
4answers
667 views

Writing a circular matrix

I have two square matrices, $A$ and $B$, of the same size, say, of $m \times m$. What I want is to write a programme/function of three variables, $A$, $B$ and $n$, that outputs the $mn \times mn$ ...
0
votes
1answer
45 views

Difference between Log and Log10 [closed]

I typed a function : f := Tan[(1/a)*Log[(Sqrt[x^2 + y^2])]] - y/x I assigned values: ...
1
vote
1answer
67 views

How to parse string to expression? [closed]

When trying to make a string an expression I see some wrong results: ...
3
votes
3answers
145 views

Creating a matrix under conditions

I would like to create a matrix whose elements satisfy the following conditions ( Mathematica 9 ) ...
1
vote
1answer
42 views

Arrange equation in normal form

Is there a way, or if not, how could one define a function which takes an equation in any form (for example as given by FullSimplify): $$(A+X_0) x+By=3x$$ and ...
5
votes
4answers
504 views

Elegant mehod of generating this matrix?

Good evening, I need to determine an elegant (as possible) method of computing an nxn matrix below (the matrix shown is just a 16x16 example). I've been toying with For loops, Tables, Bands, ...
2
votes
2answers
109 views

How to efficiently get a list like this?

I want a function myfun that generates list like this ...
2
votes
2answers
102 views

specified matrix query

can you tell me a way (best?) to get a matrix with i=N,j=N dimensions (quadratic) according to the following rules: variables: N , M, n the diagonal must contain zeros it must contain exactly M ...
3
votes
1answer
120 views

Write Integer powers as products

I need to wirte all occasions of (a+b)^3,Ftp^2, Sin[th]^2, ...etc as (a+b)*(a+b)*(a+b), Ftp*Ftp, Sin[th]*Sin[th], ...etc ...
1
vote
0answers
36 views

Code/Exp Search Documentation Center Mathematica

I have added several of my own applications to my Mathematica documentation center. Currently Mathematica uses followings notebook options to help the user search for specific functions. ...
9
votes
3answers
913 views

An inverted pyramid

I want to draw a pyramid approximately like this ...
7
votes
1answer
203 views

Why can't a string be formed by head String?

Since everything is an expression in Mathematica, why must a string object be formed by "abc" but not by a String[abc] ...
5
votes
4answers
247 views

Concatenating strings, unevaluated expressions and evaluated expressions/values

Maybe this is something very simple to some of you. Anyway, I think this can be useful to many others like me. I would like to build an output that involves strings, unevaluated expressions and ...
8
votes
11answers
1k views

Ragged Diamonds

diamond[n_Integer] := Table[1, {#}] & /@ (Range[n]~ Join~Range[n - 1, 1, -1]) diamond[5] // MatrixForm How could a more functional, "tablefree", solution ...
1
vote
2answers
65 views

Generating an Array of Vectors

I'm working a lot with nested lists of $(x,y)$ coordinates (of a FEM-like mesh, but that's not important), like so: ...
16
votes
11answers
1k views

Efficient way to build a certain quadratic matrix

For odd n I'm looking for a short and swift way to construct with (f.e.) n = 3 n = 11 ...
5
votes
2answers
260 views

How can I create a class of matrices programmatically?

I am trying to figure out how to create a function that can create the matrix pattern below, where: f[1] returns {{1}} ...
4
votes
3answers
390 views

Efficient matrix / array generation

What is the most efficient way of generating the following matrix? $\left( \begin{array}{ccccc} 1 & 0 & 1 & 0 & 1 & 0 & 1 & \dots\\ \frac{1}{2} & \frac{1}{2} & 0 ...
1
vote
1answer
46 views

expression contained across multiple cells

Is it possible to span one expression across multiple cells? E.g. long if statement or function evaluation. I looked in documentation and searched forum/google and could not find.
3
votes
1answer
361 views

Order of operations, precedence in Mathematica [duplicate]

I get confused in the order of operations in Mathematica. For example, f /@ 10^{1, 2, 3} {10, 100, 1000} In my head, that ...
3
votes
1answer
122 views

Adapting old Arrow expressions

I have an old notebook that uses the now obsolete Arrow package. For example, I have an expression containing ...
6
votes
1answer
90 views

Why only up to two \[Prime] superscripts are interpreted as derivatives?

I noticed that only up to two \[Prime] superscripts are interpreted as derivatives. Is there a reason for this restriction? Is it documented? ...
11
votes
4answers
197 views

Constraint syntax compaction

Is there a more compact way to represent these constraints: NMaximize[{a+b+c,...
8
votes
0answers
832 views

Resources on Mathematica and strong AI (a.k.a. AGI)

David Deutsch (physicist / quantum computing theorist) wrote an article for Aeon Magazine last year: On Artificial Intelligence that got me thinking. The article assesses and critiques the ...
4
votes
2answers
217 views

Getting a usable expression tree

I need to get the expression tree for some expression. expr //TreeForm The above grabs the expression tree but it isn't in some sort of usable format. Just an ...
3
votes
2answers
141 views

Creating a list from other lists and varying the number of elements that get added

Suppose I have listA = {M, F} and ListB = {a,b,c} I want to make a new ...
1
vote
1answer
170 views

The best method of constructing a product of consecutive terms

I am new to Mathematica, I am searching for a way to create an expression with a sequence of terms such as: (x-1)/x (x-2)/x (x-3)/x (x-4)/x … (x-n)/x
13
votes
2answers
571 views

Need help coding/creating a recursive list

I have two lists A and B, each with 99 real numbers. I want to form a list, C, whose ...