Tag Info

Hot answers tagged

5

I hope you will realize very soon that Mathematica is not Excel. If you begin learning the basics by mimicking how you would do it in Excel, you are off to a very bad start. Let us try to do it more in Mathematica style. First, we make a list of your elements elms = {"Gold", "Silver", "Copper"} Now, we make a function which takes an arbitrary element ...


4

Let's assume you take a credit of 10000 with monthly repayments of 100. Interest of 7% p.a. is computed monthly on the remaining balance: Rest @ NestList[# + #*0.07/12 - 100 &, 10000, 13] {9958.33, 9916.42, 9874.27, 9831.87, 9789.22, 9746.33, 9703.18, 9659.78, 9616.13, 9572.22, 9528.06, 9483.64, 9438.96} The above figures are the month end ...


3

Export["matrix.csv", m[[All, All, 1, 1, 2]]] should do the trick.


3

As Sjoerd commented I believe these kinds problems can be solved using TimeValue and Annuity, as detailed in the documentation. For example if you have a monthly payment of \$304.22 on a 36 month \$10,000 loan you can calculate your interest rate as: FindRoot[TimeValue[Annuity[304.22, 36], i/12] == 10000, {i, 0.1}] {i -> 0.0600014} (* 6% yearly ...


2

You can also use the built-in function Quantile without having to use Solve or FindRoot. m2 = Table[Quantile[StudentTDistribution[0, 1, df], (100 + Vertrauensintervall)/ 200.], {df, 3, 30, 1}, {Vertrauensintervall, {80, 90, 95, 98, 99, 99.73}}]; The result is identical to the one you get using the method suggested by @Sjoerd (to the deafult ...


2

Your table can be generated much easier and considerably faster using c = CDF[StudentTDistribution[0, 1, df], a] - CDF[StudentTDistribution[0, 1, df], -a] // FullSimplify m = Table[ a /. FindRoot[c == Vertrauensintervall/100., {a, 0.1}], {df, 3, 30, 1}, {Vertrauensintervall, {80, 90, 95, 98, 99, 99.73}} ]; This exports to a ...


2

I suppose you have something like this: expr = Table[{{1/u, u^2}, {Sqrt[u], 1/Sin[u]}}, {u, 0, 2 Pi, Pi/4}] {{{ComplexInfinity, 0}, {0, ComplexInfinity}}, {{4/π, π^2/16}, {Sqrt[π]/2, Sqrt[2]}}, {{2/π, π^2/4}, {Sqrt[π/2], 1}}, {{4/(3 π), (9 π^2)/ 16}, {Sqrt[3 π]/2, Sqrt[2]}}, {{1/π, π^2}, {Sqrt[π], ComplexInfinity}}, {{4/(5 π), (25 π^2)/16}, ...


2

Since v9 (if I recall) you can use MapAt with Span for such things: sample = {{"Sample", "Data", "creationdate", "othervariable"}, {2.3, 4.3, "20141008125809", 8.4}, {3.2, 1.3, "20141008125809", 9.2}, {3.2, 1.3, "20141008125809", 11.84}}; MapAt[fixDate, sample, {2 ;;, 3}] {{"Sample", "Data", "creationdate", "othervariable"}, {2.3, 4.3, ...


2

The easiest way to do what you want is to use the built-in function Binomial. Then all you need to write is cb[n_] := Binomial[2 n, n] a = Table[{n, N @ Log[cb[n]]}, {n, 25}]; TableForm[a] Note I used 25 in place of 250 to reduce the size of the output I show on this site to something reasonable. Plotting is trivial. ListPlot[a]


1

Perhaps Table[{j, ElementData[j, "SpecificHeat"]}, {j, {"Gold", "Silver", "Copper"}}] // TableForm or tableF = {#, ElementData[#, "SpecificHeat"]} &; tableF /@ {"Gold", "Silver", "Copper"} // TableForm (* same output *) or (* initialize a 3 by 2 table: *) table = ConstantArray[0, {3, 2}]; (* set the first column to the three element names: *) ...


1

I think the problem is in defining Fibonacci series. The following T = Table[Fibonacci[n], {n, 0, 50}]; Log[T] //N gives {-Infinity, 0., 0., 0.693147, 1.09861, ..., 23.2559}


1

This seems to me to be a situation where MapIndexed can usefully be applied. Given pts2 as generated in the question, first get rid of the unwanted last element. pts = Take[#, width] & /@ pts2; Then either of the following tbl = Join @@@ MapIndexed[With[{j = -#2[[2]]}, {{#1, j + 1}, {#1, j}}] &, pts, {2}]; tbl = ReleaseHold @ ...


1

TableForm[Table[f[a, b], {a, 10}, {b, 10}], TableHeadings -> {Range[10], Range[10]}, TableSpacing -> {1, 1}] That's just the simplest 10-by-10 example, which is what the original question asked. Here's something close to what the first comment below asks for: TableForm[Table[f[a, b], {a, 3, 30, 3}, {b, 60, 100, 10}], ...


1

Given a matrix mat replace the 0s in mat with an expression that depends on the indices. randommatrix = RandomInteger[1, {6, 6}]; randommatrix // MatrixForm MapIndexed[# /. {(0) -> Quiet@Style[Evaluate[diff2 @@ #2], Red], _ :> 0} &, randommatrix, {2}] // MatrixForm mat = 1 - Unitize[tttt2]; args = Table[{w, Pprobe}, {w, 2.5, 3., 0.1}, ...



Only top voted, non community-wiki answers of a minimum length are eligible