質問編集履歴
1
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -113,7 +113,7 @@
|
|
113
113
|
|
114
114
|
def plot_f_remez(self):
|
115
115
|
x=np.linspace(self.var_dict['lower'],self.var_dict['upper'],100)
|
116
|
-
plt.plot(x,self.f(x),'r',x,sum(self.a[i]*(x**i) for i in range(self.n+1)),'k:')
|
116
|
+
plt.plot(x,self.f(x)[0],'r',x,sum(self.a[i]*(x**i) for i in range(self.n+1)),'k:')
|
117
117
|
plt.show()
|
118
118
|
|
119
119
|
|
@@ -133,7 +133,7 @@
|
|
133
133
|
x=np.linspace(lower,upper,100)
|
134
134
|
message="result with x={x} is {result}."
|
135
135
|
|
136
|
-
print(f(x))
|
136
|
+
print(f(x)[0])
|
137
137
|
sin=BestApprox(f)
|
138
138
|
sin.remez(reference_points)
|
139
139
|
sin.plot_f_remez()
|