如何使用Matlab快速获取均方误差? [英] How to get mean square error in a quick way using Matlab?

查看:1306
本文介绍了如何使用Matlab快速获取均方误差?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否可行,但让我解释一下我的问题

I don't know whether this is possible or not but let me explain my question

想象一下我有下面的数组

Imagine that I have the below array

errors=[e1,e2,e3];

现在我要计算的是下面的

Now what I want to calculate is below

MSE=1/(array_lenght)*[e1^2+e2^2+e3^2];

我可以循环执行此操作,但我想知道是否有任何快速方法.

I can make this with a loop but I wonder if there is any quick way.

推荐答案

这将找到平方误差的平均值:

This finds the mean of the squared errors:

MSE = mean(errors.^2)

每个元素分别平方,然后找到所得向量的均值.

Each element is squared separately, and then the mean of the resulting vector is found.

这篇关于如何使用Matlab快速获取均方误差?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆