这两段代码有什么不同prediction = (vb(1:end,4)+0.15)*randn(1); % 预测结果 reference= (vb(1:end,4)+0.15); % 参考结果 c= reference(1:end,1)-prediction(1:end,1); % 画误差 for i = 1:1070 if prediction(i,1)>1,prediction(i,1)=1;end if prediction(i,1)<-1,prediction(i,1)=-1;end end subplot(211),plot(reference(:,1)) legend() hold on plot(prediction(:,1)) legend('reference','prediction') xlabel('t/s'), ylabel('Lateral velocity(m/s)') subplot(212),plot(c(:,1)) xlabel('t/s'), ylabel('Difference value(m/s)')
时间: 2023-07-16 15:12:35 浏览: 323
这两段代码的不同点在于:
1. 第一段代码中的prediction是通过对参考结果加上一个随机数来得到的;而第二段代码中的prediction直接等于参考结果。
2. 在第一段代码中,通过对prediction进行了一系列限制,使其在-1到1之间;而在第二段代码中没有对prediction进行限制。
3. 第一段代码中存在一个误差c,用于评估预测结果与参考结果之间的差异;而第二段代码中没有计算误差。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![-](https://img-home.csdnimg.cn/images/20241231044901.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![7z](https://img-home.csdnimg.cn/images/20241231044736.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)