The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
3answers
150 views

Using If statements internal to Table [duplicate]

Is there a way to use If statements with Table? To give a kind of ridiculous example that captures to spirit of what I'm trying ...
1
vote
2answers
109 views

`Slot` (#) interfering with evaluation

In the following I am using one function makeFunc to assemble two functions a[t] and b[t] to ...
2
votes
3answers
165 views

Extracing information from a table

I am new to Mathematica. I have created a table of real numbers. I want to create a new table that contains the set of values of $i$ such that, in my original table, the $i$th entry is greater than ...
0
votes
0answers
508 views

Fastest way to create a NxNxNxN dimensional matrix

I have a function that outputs a complex number Func[x_,y_]:= blah blah; I have constructed a table of all possible values of this function. ...
0
votes
1answer
59 views

Implementation of a Hanning filter

I'm implementing a package for in-house signal processing. I wrote here a quite trivial function implementing a Hanning windowing of the signal. ...
0
votes
2answers
86 views

Selecting index position of data from a table that is less than a certain value

I have a table of numbers with a few thousand entries, and I'm trying to find the first index that is less than a particular value. An example of the table I'm working on is as follows: ...
5
votes
1answer
98 views

Finding minimum fly-by radius between Mars and spacecraft from interpolating function

I've written an interplanetary trajectory solver/plotter that plots the path taken by a spacecraft on an Earth-Mars mission, but have run into a little trouble when the spacecraft actually reaches ...
3
votes
2answers
159 views

How to make sure Table or Do only runs through specific values?

I often need to generate or run through very large numbers of integers (we're talking {i, 1, 10^9} and higher) and want to add certain integers to a list, say ...
2
votes
2answers
250 views

Parametric plot of multiple graphs on the same axes

I'm trying to plot on a single axes system multiple graphs but ran into a problem when tryinf to label my graphs. Here's what I've used so far Mathematica code: ...
0
votes
0answers
123 views

Savitzky-golay filter

How to use Savitzky-golay filter on csv file? I have file.csv in this format: 0.1,1.6,2.8,0 0.2,1.2,2.3,1 0.7,1.5,2.4,2 0.6,1.2,2.7,3 0.4,1.4,2.9,4 0.3,1.3,2.5,5 ...
0
votes
1answer
54 views

Slow evaluation of complicated Table

I have a system of recursive equations x[t+1]:=f[x[t],p[t-1],a[t],a[t-1]]; p[t+1]:=g[p[t],x[t-1],a[t],a[t-1]]; a[t+1]:=h[x[t],p[t],a[t],a[t-1]]; I want to ...
2
votes
2answers
148 views

Converting from TableForm to Grid

I wonder if there is an easy way to convert from TableForm to Grid. I have an existing data format that uses the Table function that I’d like to prettify…. Let’s setup a nested table as follows: ...
0
votes
1answer
48 views

Using Derivative with list in curly brackets

I'd like to make a formula for a sum containing Derivative where the number of arguments in the latter depends on an input parameter n. Also involved is a list ...
1
vote
2answers
57 views

How do I get the heading elements from the TableForm option TableHeadings?

The following, table = TableForm[ConstantArray[0, {3, 3}], TableAlignments -> Right, TableHeadings -> {None, {"One", "Two", "Three"}}] generates ...
1
vote
0answers
80 views

Parallel numerically integrated function can't be plotted

I've been working on a problem where I need to integrate a function numerically. The function is quite complex and it takes almost an hour for Mathematica to make a plot. To speed the process up I ...
2
votes
2answers
427 views

Fast way to extract data from a list

I used data=Table[{i,f[i]},{i,1,n}] to produce a list, here n is greater than 2^20 = 1048576. The function f(N) runs in time ...
0
votes
0answers
65 views

Output solutions from large amount of multiple parameters to external files?

I have some code that solves an ugly PDE by using the results of another, and outputs the value of the solution between a range $mic \leq r \leq r_{o}$. It looks something like this ...
5
votes
2answers
292 views

How to create this list more elegantly

There is list containing some $(i,j)$ values of indices. Now i want to create a matrix of dimension n $\times$ m whose entries are 1 for the indices corresponding to the given list otherwise its ...
2
votes
2answers
128 views

Generating an editable table that can be used as input

Say I have a number $n_{max}$. I want a command to generate a table like 1 1 2 2 3 3 4 4 ... nmax nmax where the second column is editable, and this table can be ...
0
votes
2answers
103 views

Define a function on a parameter argument set to zero

Say I have an expression (matrix) that depends on several variables. f= {{a, b+c},{2a-b^2,c^5+a b}} I want to define new matrices with the single parameter ...
2
votes
1answer
33 views

Table doesn't replace inside conditionals (If, Which) [duplicate]

This: Table[If[cond, y], {y, 1, 3}] outputs this: {If[cond, y], If[cond, y], If[cond, y]} The ...
1
vote
3answers
132 views

More elegant/efficient solution to browse through an array

I have an array of lists and want to correlate every list with each other like this: ...
-1
votes
1answer
162 views

Mathematica Semilog (LogLinearPlot) using x,y points from table [duplicate]

I am trying to use the LogLinearPlot in Mathematica 9 to create an x-axis only logarithmic plot that looks like this (Based on N^1.85 graphing paper) http://pingfire.com/ What it does is model a ...
4
votes
5answers
199 views

How to make a table of $\sum_{i=1}^n$?

I want to create a table of $\displaystyle \sum_{i=1}^n i^k$ for $1\le k\le 5$. The output I want to obtain is a TeXForm output as follows. \begin{align} ...
0
votes
2answers
101 views

Delete False values from a list [closed]

I have table: t = {False, False, False, a <= 456, a <=567, a<= 897} I want to delete all values which are 'False' and make my table to looks like: ...
1
vote
1answer
62 views

Testing a List inside of an Table if it is != 0 [duplicate]

I'm new to mathematica so I hope this is not a too stupid question, but I couldn't find a solution in the mathematica documentation. I've got a normal table, initialized with "0" as entries. In the ...
2
votes
0answers
103 views

Want explanation of when different looping constructs are appropriate [duplicate]

For example when would you use a Do loop over a For loop? For which tasks would you use Map, ...
1
vote
1answer
167 views

How to convert the following list into a LaTeX table?

How to convert the output of the following code In[43]:= Func[x_]:=Select[Range[x],Total[IntegerDigits[#]^3]==#&]; Func[1000] which is Out[44]= ...
1
vote
2answers
127 views

How to sort Table/Matrix including legend(Labellings)

I want to sort table including its legend for graph I have table similar to M1 M2 M3 1 5 2 3 1 4 4 2 -10 5 7 11 6 -2 1 ...
3
votes
4answers
139 views

AccountingForm w/o significant figures

Basically I want to build a chart like something I would do in Excel. It should look like this: Here is the formula I'm using and what I've done so far ...
1
vote
3answers
141 views

Table iteration over two ranges

I am trying to create a Table where the iterator has two ranges with different iteration steps. Let's consider a simple example: I want to find the square of the ...
5
votes
4answers
418 views

A fast way to compute arrays avoiding If or Which

I found out that if I have to calculate huge arrays with most of the elements being zero( let's say each row has 10000 elements and only 8 are non zero) and the non zero elements' positions being ...
0
votes
0answers
43 views

Store results of inequality [duplicate]

I eveluated some values using Reduce commend and I store them in a Table ...
0
votes
3answers
96 views

Reduce of a table [duplicate]

I have a table for example: t = Table[k,{k,5}] which returns {1,2,3,4,5} and for every element in this table I want to check ...
1
vote
1answer
82 views

Transpose a ragged triangular matrix and display as columns rather than rows

I have a triangular list of lists as follows: ...
0
votes
0answers
67 views

Widget - GUI help

I was wondering if someone could explain me the code written below (example File Dialog from mathematica). Especially the part with returnValueand ...
0
votes
1answer
108 views

How to create 2k sized vector in k sized loop

I want to solve a system of simple differential equations. At some point I need to solve non-linear system of algebraic equations with Newton method. I would like to efficiently create a right hand ...
2
votes
1answer
82 views

Minimize amount of evaluations with fold/table/thread or something else

I can't figure out how to use fold/table/map/distribute or whatever to get this: ...
0
votes
2answers
193 views

Using a table to format a grid

Ok, I can't wrap my head around this because I don't know Mathematica well enough yet, so I'm asking for help, at least a direction to explore in. I have a Grid: ...
1
vote
0answers
77 views

Generating a variable size table one element at a time

I can produce a variable size list of strings like AACBBAABC with this code: ...
2
votes
1answer
175 views

How can I create a colour image using raw black and white data? (FITS data cube)

I have a data cube containing pictures of a galaxy across a thousand wavelengths. I want to take the data for the image slides in the red and blue parts of the spectrum, and have them represented in ...
0
votes
2answers
134 views

Conditional Table

I have following : SeedRandom[2] Table[Table[RandomInteger[100, {100, 10}][[r, s]] == x[r + s], {r, 1, 10}], {s,1,10}] How can I set condition inside Tables?Such ...
5
votes
2answers
177 views

Interactive grid

I would like to create an interactive grid, whereby one number from a grid is selected by the cursor ("3" in the example below), and all other numbers in the grid are highlighted that are related to ...
0
votes
2answers
132 views

Combining graphics & lists / tables

I have: created with: ...
1
vote
1answer
172 views

Suppress warnings in ParallelTable

I'm using ParallelTable to evaluate a function that involves NIntegrate. There are a lot of ...
2
votes
2answers
187 views

Table of Variables

I use a list of variables {x1, x2, x3} to Solve a particular set of equations. I am now trying to generalise this depending on ...
-1
votes
1answer
119 views

Efficient Table Generation & NDSolve Error

I'm currently working on solving an SEIR model with data from the CDC. I've created a function to calculate the Square difference for the model and want to create a table of values for the 4 variable ...
-2
votes
1answer
85 views

Suppressing Null output with sparse data? A lot of zeros and little nonzeros

I have sparse situation with a lot of zeros, related chat. I want to see only the nonzero things or nonnull things. Example Input ...
1
vote
4answers
132 views

Why FieldSeparators is printing a lot of quotation marks instead of just spaces?

In the following code "FieldSeparators"->" " prints a lot of quotation marks in the output file, instead of just spaces. What's wrong with it? ...