我今天在Mathematica中遇到了这个错误:
Set::shape: "Lists {0,0,0,0,0,0,0,0,0,0} and {0,0,0,0,0,0,0,0,0,0,{1}} are not the same shape" >>
在其中 3 个之后:
General::stop : Further output of Set::shape will be suppressed during this calculation. >>
我很困惑为什么我不能将“1”附加到我的零列表中。这是因为我无法编辑传递给函数的列表吗?如果是这样,我如何编辑该列表并以某种方式返回或打印它?
这是我的完整代码:
notFunctioningFunction[list_] := (For[i = 1, i < 10, i++, list = Append[list, {1}]];
Print[list])
list = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
notFunctioningFunction[list]
我附加“{1}”的原因是因为在我的函数中,我正在求解一个方程,并获取输出 {1} 的变量的值。这是我的代码:
varName / . Solve[ function1 == function2 ]
显然我是Mathematica的初学者,所以请耐心等待 :)
谢谢,
布科