深度学习 求解方程的代码
A = 1:10;
result(1:10) = 5;
W(1:10) = 0.1;
threhold(1:10)=0.5;
step = 0.1;% 每次走的步数
Y = W.*A;
P = [];
while abs(sum(sum(Y))-50)>=0.5
Y = W.*A;
d = result - Y;
W = W+0.05.*d;
Myans = sum(sum(Y));
disp(Myans);
P = [P Myans];
pause(0.2);
end