Step4:利用神经网络算法进行
初始化摄像头连接
初始化小车控制连接
初始化操纵杆
将图像数据输入神经网络
将神经网络输出作为方向控制数据发送到小车
• PREDICT(Theta1, Theta2, X);%outputs the predicted label of X given the trained weights of a neural network (Theta1, Theta2)
• sim(net,input); %调用matlab神经网络工具箱自带的sim函数得到网络的预测值
注意事项:
• 数组、向量维度、数组向量的转置操作
• 神经网络的输入输出与操纵杆输入、小车控制数据的格式要匹配