mathematica,如何在结果中去掉括号{}?result = NDSolve[{h''[x]/(1 + (h'[x])^2)^(3/2) - h[x]/2 == 0,h[1] == 2,h'[2] == 1},h[x],{x,1,2}];Column[Table[h[x] /.result,{x,1,2,0.1} ]]结果显示中,每个数字都有{},如何在mathematica中修改

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 11:37:28
mathematica,如何在结果中去掉括号{}?result = NDSolve[{h''[x]/(1 + (h'[x])^2)^(3/2) - h[x]/2 == 0,h[1] == 2,h'[2] == 1},h[x],{x,1,2}];Column[Table[h[x] /.result,{x,1,2,0.1} ]]结果显示中,每个数字都有{},如何在mathematica中修改

mathematica,如何在结果中去掉括号{}?result = NDSolve[{h''[x]/(1 + (h'[x])^2)^(3/2) - h[x]/2 == 0,h[1] == 2,h'[2] == 1},h[x],{x,1,2}];Column[Table[h[x] /.result,{x,1,2,0.1} ]]结果显示中,每个数字都有{},如何在mathematica中修改
mathematica,如何在结果中去掉括号{}?
result = NDSolve[{h''[x]/(1 + (h'[x])^2)^(3/2) - h[x]/2 == 0,
h[1] == 2,h'[2] == 1},h[x],{x,1,2}];
Column[Table[h[x] /.result,{x,1,2,0.1} ]]
结果显示中,每个数字都有{},如何在mathematica中修改语句使其不在结果中显示,thanks so much
{2.0000000000454814}
{1.9739365557219797}
{1.958420519163772}
{1.9528880982174592}
{1.9571482119625454}
{1.971347553976617}
{1.9959972705167932}
{2.0320735540144113}
{2.081244348214623}
{2.146371988525206}
{2.232770665875334}

mathematica,如何在结果中去掉括号{}?result = NDSolve[{h''[x]/(1 + (h'[x])^2)^(3/2) - h[x]/2 == 0,h[1] == 2,h'[2] == 1},h[x],{x,1,2}];Column[Table[h[x] /.result,{x,1,2,0.1} ]]结果显示中,每个数字都有{},如何在mathematica中修改
希望对你有所帮助:
输入:
result =
NDSolve[{h''[x]/(1 + (h'[x])^2)^(3/2) - h[x]/2 == 0,h[1] == 2,
h'[2] == 1},h[x],{x,1,2}]; // Quiet
Column[Table[h[x] /.result[[1]],{x,1,2,0.1}]]
输出(你自己执行以下就会发现中括号没了):
\!\(\*
TagBox[GridBox[{
{"2.`"},
{"1.9739365556714714`"},
{"1.9584205191082824`"},
{"1.9528880981568602`"},
{"1.9571482118965418`"},
{"1.9713475539047176`"},
{"1.995997270438247`"},
{"2.032073553928077`"},
{"2.0812443481187106`"},
{"2.1463719884166874`"},
{"2.2327706657483635`"}
},
GridBoxAlignment->{"Columns" -> {{Left}}},
GridBoxItemSize->{
"Columns" -> {{Automatic}},"Rows" -> {{Automatic}}}],
"Column"]\)

修改成如下即可:
result = NDSolve[{h''[x]/(1 + (h'[x])^2)^(3/2) - h[x]/2 == 0,
h[1] == 2, h'[2] == 1}, h[x], {x, 1, 2}][[1]];
Column[Table[h[x] /. result, {x, 1, 2, 0.1}]]
多加了一个[[1]]代表取括...

全部展开

修改成如下即可:
result = NDSolve[{h''[x]/(1 + (h'[x])^2)^(3/2) - h[x]/2 == 0,
h[1] == 2, h'[2] == 1}, h[x], {x, 1, 2}][[1]];
Column[Table[h[x] /. result, {x, 1, 2, 0.1}]]
多加了一个[[1]]代表取括号内的第一项,因为括号里只有一项,而且是数字,所以只会显示数字,不会有括号,对于括号的其它呈现形式都可以用此方法处理!

收起