Tag Info

Hot answers tagged

7

TableForm[ Table[{NumberForm[t, {Infinity, 1}], NumberForm[f[t], {Infinity, 1}], NumberForm[g[t], {Infinity, 3}]}, {t, 0, 2, .5}], TableHeadings -> {{}, {t, x, y}}, TableAlignments -> "."]


6

SetPrecision[tab, 7] // TableForm


4

There are a lot of syntax errors and general messiness in this code. My proxy server won't let me download FinancialData at the moment, so I can't test this completely, but several things you should note: intermediate variables should localised using Module. syntax error: y = Take[ema {2}] should be y = Take[ema, {2}] or just ema[[2]]. ...


2

L = StringSplit["I want to create a matrix by laying"] {"I", "want", "to", "create", "a", "matrix", "by", "laying"} Outer[f, L, L] // TableForm


1

Using Piecewise is a good choice. gradePoint[grade_] := With[{g = Ceiling[grade]}, Piecewise[{{4., g >= 80}, {3.75, g >= 75}, {3.5, g >= 70}, {3.25, g >= 65}, {3., g >= 60}, {2.75, g >= 55}, {2.5, g >= 50}, {2.25, g >= 45}, {2., g >= 40}}, 0]]; You may check whether the function works perfectly. ...


1

You can use TableForm to set up the table. row1 = {"GP", 0, 2., 2.25, 2.5, 2.75, 3.0, 3.25, 3.75, 4.}; row2 = {"Marks", "0-39", "40-44", "45-49", "50-54", "55-59", "60-64", "65-69", "70-74", "75-79", "80-100"}; {row2, row1} // TableForm It wasn't clear to me what you want to do with this data, but you can get the mean of the GPs with ...


1

Your can use Replace* inside Hold or Deffer like this: x = 12; test = Defer[Sin[x]^2 + Cos[x]^2] == Sin[x]^2 + Cos[x]^2 Sin[x]^2 + Cos[x]^2 == 1. Block[{x}, test /. x -> y] /. y -> x Sin[12.]^2 + Cos[12.]^2 == 1. Just idea, no doubt better approach can be found.


1

There are a number of errors in your code, so hopefully going through them one by one will help you in your task. First, I'll define numbers to insert into the matrices: h[k_, l_] := k Sin[l]; g[i_, k_, l_] := 10/(1 + i^2 + k^2 + l^2) + RandomReal[]; f[i_, l_] := i l; x[l_] := 1; M = 10; n = 4; The first line of code, H = Table[H[k, l], {k, 2 M}, {l, 2 ...


1

since this has popped up as unanswered, one approach to this if you really want to use floating values as "indices" is to save up the "index" values and use them directly as iterators: dbvals = Table[ dBx , {dBx, .1, .5, .05} ] ; bzvals = Table[ Bz , {Bz, .4, 1.5, .1} ] ; Do[data[dBx, Bz] = {x, f[dBx, Bz]}, {dBx, dbvals}, {Bz, bzvals}] ListDensityPlot[ ...



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