Mathematica - 用值和指数函数绘制数组

时间:2012-05-13 14:58:32

标签: arrays wolfram-mathematica plot exponential

我对mathematica有疑问。我有一个名为tempDep的值的数组:

{10.7072,11.5416,12.2065,12.774,13.2768,13.7328,14.1526,14.5436,14.9107,15.2577,15.5874,15.9022,16.2037,16.4934,16.7727,17.0425,17.3036,17.5569,17.803,18.0424,18.2756,18.503,18.725,18.9419,19.154,19.3615,19.5647,19.7637,19.9588,20.1501,20.3378,20.5219,20.7025,20.8799,21.0541,21.2252,21.3933,21.5584,21.7207,21.8801,22.0368,22.1908,22.3423,22.4911,22.6374,22.7813,22.9228,23.0619,23.1987,23.3332,23.4655,23.5955,23.7235,23.8493,23.973,24.0947,24.2143,24.332,24.4478,24.5616,24.6736,24.7837,24.892,24.9986,25.1034,25.2064,25.3078,25.4075,25.5055,25.602,25.6968,25.7901,25.8819,25.9722,26.061,26.1483,26.2342,26.3186,26.4017,26.4835,26.5638,26.6429,26.7207,26.7972,26.8724,26.9464,27.0192,27.0908,27.1612,27.2304,27.2986,27.3656,27.4315,27.4963,27.56,27.6227,27.6844,27.7451,27.8048,27.8635,27.9212,27.978,28.0338,28.0887,28.1428,28.1959,28.2482,28.2996,28.3502,28.3999,28.4488,28.497,28.5443,28.5908,28.6366,28.6817,28.726,28.7695,28.8124,28.8545,28.896,28.9368,28.9769,29.0163,29.0551,29.0933,29.1308,29.1678,29.2041,29.2398,29.2749,29.3095,29.3435,29.3769,29.4098,29.4421,29.474,29.5053,29.536,29.5663,29.5961,29.6254,29.6542,29.6825,29.7104,29.7378,29.7647,29.7913,29.8173,29.843,29.8682,29.893,29.9175,29.9415,29.9651,29.9883,30.0112,30.0336,30.0557,30.0775,30.0989,30.1199,30.1406,30.1609,30.1809,30.2006,30.22,30.239,30.2578,30.2762,30.2943,30.3121,30.3297,30.3469,30.3639,30.3806,30.397,30.4131,30.429,30.4446,30.4599,30.4751,30.4899,30.5045,30.5189,30.533,30.5469,30.5606,30.5741,30.5873,30.6003,30.6131,30.6257,30.6381,30.6503,30.6623,30.674,30.6856}

我正在使用

进行绘图
ListPlot[tempDep]

我想要做的是在一个图表中将该图与指数(应该与此listPlot看起来非常相同)一起显示。你可以帮我解决这个问题吗?

3 个答案:

答案 0 :(得分:0)

您可以使用

f = Interpolate[tempDep]

然后使用

绘制插值函数的图形
Plot[f,{x,1,198}]

答案 1 :(得分:0)

也许是这样的?

data = Table[Sin[x], {x, 0, 2 Pi, 0.3}];

Show[
 ListPlot[data, PlotStyle -> PointSize[0.02]],
 ListLinePlot[data,
   InterpolationOrder -> 2,
   PlotStyle -> Directive[Thick, Orange]]
]

Mathematica graphics

答案 2 :(得分:0)

在我看来,你的数据服从其他东西,但如果你想要指数拟合:

model    = a + b Exp[c + d x];
tempDep1 = Partition[Riffle[Range@Length@tempDep, tempDep], 2];
fit      = FindFit[tempDep1, model, {a, b, c, d}, x, Method -> NMinimize];
modelf   = Function[{x}, Evaluate[model /. fit]]
Plot[modelf[t], {t, 0, Length@tempDep}, Epilog -> Point@tempDep1]

enter image description here